Display product large image in category list


I’ve came across the forum and couldn’t find a solution.

I am looking to get on a category page for 2.0.12 to list the large images instead of being stuck with the thumbnail image.

In my case, I tried to customize the compact_list.tpl file that calls originally {include file=“common_templates/image.tpl” image_width=“250” obj_id=$obj_id_prefix images=$product.main_pair object_type=“product”}

I was able to display the large image instead of the thumbnail on the product detail page by calling another imageXX.tpl file and in the image src get it to look for src=“{$images.detailed.image_path}” which works fine. But on the category list page, it calls directly the common_templates/image.tpl and if I change the src of the image to {$images.detailed.image_path} it won’t work.

Does anybody has any trick so I can display the large image from the category listing using the image.tpl or a new image.tpl file??

Thanks so much

Ok I figured it out.

For your info here is what you need to do:

Edit [cscart_dir]/core/fn.images.php from your existing Cs-Cart installation,

Find the following code:

if (!empty($p_data[‘detailed_id’]) && $get_detailed == true) {

and replace with this:

if (!empty($p_data[‘detailed_id’])) {

Save, close.

Then create a new image.tpl under common_templates that you’ll call from your category list template (gridview or short_list…) and call the new image.tpl file.

Change in this new image.tpl the src of the image to {$images.detailed.image_path|default:$images.icon.image_path}

That’s it