Jump to content

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

Trying To Create Custom Template For Products Listing Without Success :( Rate Topic   - - - - -

 
  • alaa
  • Member
  • Trial users
  • Join Date: 18-Mar 18
  • 20 posts

Posted 23 April 2018 - 07:34 PM #1

Hello, 

Really appreciate your help in this. 

 

I want to create custom template to show my products using the products showcase block. The issue is that the image of the product doesn't show. I did the following: 

 

I copied the file of the existing template that I want to customize from this path: 

/var/www/html/[site]/design/themes/responsive/templates/blocks/products/products_scroller.tpl

Then put it in this directory: 

/var/www/html/[site]/design/themes/[my_custom_theme]/templates/blocks/products/custom_products_scroller.tpl

I extended the schemes for the new template. 

 

My problem is the image doesn't show and no-image icon appears. 

 

Tried the following: 

- I copied the original template without any modifications except the template name and file name - no luck. 

- Tried the above using my changes addon - no luck. 

- Deleted cache/uploaded new images - no luck. 

 

Anyone can help me please. Did I miss any thing? 

 

Thank you! 



 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 373 posts

Posted 23 April 2018 - 08:31 PM #2

Hello, 

Really appreciate your help in this. 

 

I want to create custom template to show my products using the products showcase block. The issue is that the image of the product doesn't show. I did the following: 

 

I copied the file of the existing template that I want to customize from this path: 

/var/www/html/[site]/design/themes/responsive/templates/blocks/products/products_scroller.tpl

Then put it in this directory: 

/var/www/html/[site]/design/themes/[my_custom_theme]/templates/blocks/products/custom_products_scroller.tpl

I extended the schemes for the new template. 

 

My problem is the image doesn't show and no-image icon appears. 

 

Tried the following: 

- I copied the original template without any modifications except the template name and file name - no luck. 

- Tried the above using my changes addon - no luck. 

- Deleted cache/uploaded new images - no luck. 

 

Anyone can help me please. Did I miss any thing? 

 

Thank you! 

 

You will have to create a new block using the blocks schema. You can find more about this in the user docs.

 

Kind regards,


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • alaa
  • Member
  • Trial users
  • Join Date: 18-Mar 18
  • 20 posts

Posted 23 April 2018 - 08:37 PM #3

You will have to create a new block using the blocks schema. You can find more about this in the user docs.

 

Kind regards,

 

Thank you for your reply! 

 

Do you mean this: 

<?php
$schema['blocks/products/custom_products_scroller.tpl'] = array (
	'settings' => array(
		'show_price' => array (
			'type' => 'checkbox',
			'default_value' => 'Y'
		),
		'enable_quick_view' => array (
			'type' => 'checkbox',
			'default_value' => 'N'
		),
		'not_scroll_automatically' => array (
			'type' => 'checkbox',
			'default_value' => 'N'
		),
		'scroll_per_page' =>  array (
			'type' => 'checkbox',
			'default_value' => 'N'
		),
		'speed' =>  array (
			'type' => 'input',
			'default_value' => 400
		),
		'pause_delay' =>  array (
			'type' => 'input',
			'default_value' => 3
		),
		'item_quantity' =>  array (
			'type' => 'input',
			'default_value' => 5
		),
		'thumbnail_width' =>  array (
			'type' => 'input',
			'default_value' => 80
		),
		'thumbnail_height' =>  array (
			'type' => 'input',
			'default_value' => 80
		),
		'outside_navigation' => array (
			'type' => 'checkbox',
			'default_value' => 'Y'
		)
	),
	'bulk_modifier' => array (
		'fn_gather_additional_products_data' => array (
			'products' => '#this',
			'params' => array (
				'get_icon' => true,
				'get_detailed' => true,
				'get_options' => true,
			),
		),
	),
);
return $schema;

I already created this and options of my new template appears in the layout manager. But still no image of the product shows. It shows the no-image icon. Name of the product, link and all other information are fine except no image! 



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

Posted 23 April 2018 - 10:42 PM #4

No.  On the layouts page, go to Blocks/Add Block.  Then you should see your new block listed.  Select that block and give it a name.  You would then use that block in your layout.


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.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17267 posts

Posted 24 April 2018 - 05:22 AM #5

To get images form database, you should add bulk_modifier for your template with schema. Use example from post #3

	'bulk_modifier' => array (
		'fn_gather_additional_products_data' => array (
			'products' => '#this',
			'params' => array (
				'get_icon' => true,
				'get_detailed' => true,
				'get_options' => true,
			),
		),
	),

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alaa
  • Member
  • Trial users
  • Join Date: 18-Mar 18
  • 20 posts

Posted 24 April 2018 - 03:38 PM #6

I managed to get it working. I don't know what was the problem but maybe I had a syntax error in the schema extension. 

Anyway, thank you all for your replies! 



 
  • alaa
  • Member
  • Trial users
  • Join Date: 18-Mar 18
  • 20 posts

Posted 24 April 2018 - 03:47 PM #7

In fact, I had no syntax error. I just have to disable and re-enable my changes addon for all changes to take effect. 

 

So you will have to deactivate/activate my changes addon for schemas to take effect. 



 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 373 posts

Posted 24 April 2018 - 04:42 PM #8

In fact, I had no syntax error. I just have to disable and re-enable my changes addon for all changes to take effect. 

 

So you will have to deactivate/activate my changes addon for schemas to take effect. 

 

Hello,

 

This is because all the schemas (with their .post and .pre extensions) are merged into one file and then saved in the cache. Next time just add ?cc&ctpl to your admin url, that should do the job as well.

 

Kind regards,


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).