Jump to content

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

Add new template and wrapper for featured products on home page Rate Topic   - - - - -

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

Posted 03 October 2012 - 12:25 PM #1

hello, i successfully displayed featured products on home page by instruction given in this link,
http://kb.cs-cart.co...d-products-home
but, i need to change design of that as per my requirements,
if i change that template's .tpl file directly, it will not affect everywhere in site when i called that block ?
so i want to create a new template and wrapper for that which i can set from admin for featured products ?
anyone have any idea about how to do that ?

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

Posted 03 October 2012 - 01:27 PM #2

Anyone Pleaseee..

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

Posted 03 October 2012 - 01:36 PM #3

Please check below screenshot, i want to add new template and wrapper type for featured block in Design -> Blocks -> HomePage

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

Posted 03 October 2012 - 01:39 PM #4

Please check below screenshot, i want to add new template and wrapper type for featured block in Design -> Blocks -> HomePagemyscreen.png

 

Posted 03 October 2012 - 01:59 PM #5

hello, i successfully displayed featured products on home page by instruction given in this link,
http://kb.cs-cart.co...d-products-home
but, i need to change design of that as per my requirements,
if i change that template's .tpl file directly, it will not affect everywhere in site when i called that block ?
so i want to create a new template and wrapper for that which i can set from admin for featured products ?
anyone have any idea about how to do that ?


The wrapper files are here:
/skins/YOURSKIN/customer/blocks/wrappers
Changing wrappers is very easy. Simply copy one of the default template files, and replace with your content.

The template files are bit tricky.
You have to add some array to the
/schemas/block_manager/templates.php
and you have to place your unique template file to the skins directory. If you familiar with PHP and Smarty, you can do this very easily.

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

Posted 03 October 2012 - 02:15 PM #6

thanks for your help mate,
I copied a default products_multicolumns.tpl and made changes in
/schemas/block_manager/templates.php
i put below code exactly after products_multicolumns.tpl's code
'blocks/products/products_featured.tpl' => array (
	    'settings' => array(
		    'item_number' => array (
			    'type' => 'checkbox',
			    'default_value' => 'N'
		    ),
		    'number_of_columns' => array (
			    'type' => 'input',
			    'default_value' => 2
		    )
	    ),
	    'bulk_modifier' => array (
		    'fn_gather_additional_products_data' => array (
			    'products' => '#this',
			    'params' => array (
				    'get_icon' => true,
				    'get_detailed' => true,
				    'get_options' => false,
			    ),
		    ),
	    ),
    ),
but now its displaying 2 options with same name in Template Dropdown as "Grid".
how can i change that title ?

 

Posted 03 October 2012 - 02:59 PM #7

thanks for your help mate,
I copied a default products_multicolumns.tpl and made changes in

/schemas/block_manager/templates.php
i put below code exactly after products_multicolumns.tpl's code
'blocks/products/products_featured.tpl' => array (
		'settings' => array(
			'item_number' => array (
				'type' => 'checkbox',
				'default_value' => 'N'
			),
			'number_of_columns' => array (
				'type' => 'input',
				'default_value' => 2
			)
		),
		'bulk_modifier' => array (
			'fn_gather_additional_products_data' => array (
				'products' => '#this',
				'params' => array (
					'get_icon' => true,
					'get_detailed' => true,
					'get_options' => false,
				),
			),
		),
	),
but now its displaying 2 options with same name in Template Dropdown as "Grid".
how can i change that title ?


In your template file, you have a block description in the first line like this:
{** block-description:products_grid **}
Change the name to eg. "featured_products"
{** block-description:featured_products **}
I am not sure, but I think, this will resolve your issue.

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

Posted 03 October 2012 - 03:15 PM #8

Thank you very very much, it worked :grin:

 

Posted 03 October 2012 - 04:28 PM #9

Thank you very very much, it worked :grin:

You are welcome. (Reputation points will be appreciated ;])