Hi
My prestashop version is 1.7.2.4
Yes I use custom theme
I forget to mention all steps that I implemented:
1. Create file category-20.tpl identical as category.tpl
2. Modify code in category-20.tpl (instead of standard product-list.tpl change to product-list-custom.tpl)
{extends file='catalog/listing/product-list-custom.tpl'}
3. Create file product-list-custom.tpl identical as product-list.tpl
4. Modify the code in product-list-custom.tpl (instead of standard product.tpl change to product-custom.tpl)
{include file='catalog/_partials/products-custom.tpl' listing=$listing}
5. Create file product-custom.tpl identical as product.tpl
6. Modify the code in product-custom.tpl (instead of standard miniature product.tpl change to custom miniature product-custom.tpl)
{include file='catalog/_partials/miniatures/product-custom.tpl' product=$product}
7. Finally in the file catalog/_partials/miniatures/product-custom.tpl I did the hereunder modification to show another image in product listing
<img
......
src = "{$product.cover.bySize.home_default_2.url}"
.....
>
So after this modification when I visited my category "20" page on front office, it was working
The problem came when I sored products or filtered them
The page reloaded and showed the standard render by using standard category.tpl
So I just found some interesting info in the doc about render:
http://developers.prestashop.com/themes/templates/100-listing.html#extending-product-list-template
The responsible function is updateProductListDOM
function updateProductListDOM (data) {
$('#search_filters').replaceWith(data.rendered_facets);
$('#js-active-search-filters').replaceWith(data.rendered_active_filters);
$('#js-product-list-top').replaceWith(data.rendered_products_top);
$('#js-product-list').replaceWith(data.rendered_products);
$('#js-product-list-bottom').replaceWith(data.rendered_products_bottom);
}
And the file "classes/controllers/ProductListingFrontController.php" is helped me to fix this problem
Thanks Razaro!
So this is a solution, but I'm wondering if there isn't another way to resolve this problem because if Prestashop giving the possibility tu customize templates for specific category so there should be a way to have the same render even when sorting or filtering, or they forget this part!