xrdm Posted January 30, 2018 Share Posted January 30, 2018 Hi there, do you know how, in prestashop 1.7.x, show a different product tpl if the product child of a unique category? eg.: I wish to display a different product gallery effect and text for all product pages that are in a specific category. Thanks Link to comment Share on other sites More sharing options...
xrdm Posted February 7, 2018 Author Share Posted February 7, 2018 On 31/1/2018 at 3:50 PM, horiatb said: You could have just one templete file and use conditional statements inside based on category ID. Something like: {if $product.id_category_default == 5} //some code {/if} Or maybe add the category id as a class and do something via css, like: <section id="main" class="category-{$product.id_category_default}" itemscope itemtype="https://schema.org/Product"> .... thank you horiatb! The first solution is good for me Link to comment Share on other sites More sharing options...
xrdm Posted February 13, 2018 Author Share Posted February 13, 2018 On 31/1/2018 at 3:50 PM, horiatb said: You could have just one templete file and use conditional statements inside based on category ID. Something like: {if $product.id_category_default == 5} //some code {/if} Or maybe add the category id as a class and do something via css, like: <section id="main" class="category-{$product.id_category_default}" itemscope itemtype="https://schema.org/Product"> .... @horiatb Do you know how to show different layout (include different partial product list) depending on category id in a module on homepage? (prestashop 1.7) I've a module on homepage that list products including {include file="catalog/_partials/miniatures/product.tpl" product=$product} How can I say it to include a different tpl if it have to list items in category 15? thanks 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now