Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

how to add "Cart content" block in tpl file Rate Topic   - - - - -

 
  • developer
  • Member
  • Members
  • Join Date: 02-Jan 12
  • 42 posts

Posted 05 October 2012 - 02:26 PM #1

How can i call/add "Cart content" block in .tpl file ? is there a way to call any block's content directly ?

 
  • developer
  • Member
  • Members
  • Join Date: 02-Jan 12
  • 42 posts

Posted 08 October 2012 - 06:32 AM #2

anyone..??

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1249 posts

Posted 08 October 2012 - 07:05 AM #3

{include file="blocks/cart_content.tpl"}

 
  • developer
  • Member
  • Members
  • Join Date: 02-Jan 12
  • 42 posts

Posted 08 October 2012 - 09:03 AM #4

ohh thanks buddy, i was thinking it would be very hard to call any block's content in cs-cart, but its so simple, core php type just include. :D

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11429 posts

Posted 08 October 2012 - 06:41 PM #5

Note that the cart is special so it's easy. The cart is maintained in the session so it's contents are already there. But other blocks have to be 'filled' appropriately by the controller or block_manager before they will have any valid content.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • developer
  • Member
  • Members
  • Join Date: 02-Jan 12
  • 42 posts

Posted 09 October 2012 - 07:09 AM #6

can you please explain in detail with specific block's example ? as I am new to cs-cart and really want to know how cs-cart handles all this.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11429 posts

Posted 09 October 2012 - 07:20 AM #7

Sorry, way too much info to reveal in a forum thread.

There are hundreds of threads here on using hooks to modify content.
Suggest you do a search for posts by me and you'll see a series of about 6 tutorials about using PHP hooks which is really a tutorial on how to create an addon, add content, etc. I think it was the developers forum where those posts were made.
You can find many other posts about blocks and block configuration too.

Things have changed some in V3, but essentially, things are done the same with minor differences.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • developer
  • Member
  • Members
  • Join Date: 02-Jan 12
  • 42 posts

Posted 10 October 2012 - 12:41 PM #8

ok thanks, i will check that.
can we call an html block directly in .tpl file ?

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11429 posts

Posted 10 October 2012 - 07:10 PM #9

A block is simply a template that expects certain template data (variables). So you might need to create a controller that assigns the appropriate variables expected by the block (template).

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.