Sivo Posted January 22, 2014 Share Posted January 22, 2014 (edited) Hello, I am having troubles with the following problem: I am editing the category page (product-list.tpl) for display an accordion of subcategories and products associated to them. Using this code wich I edited will show the subcategories from the main category and the products, but it shows all the products not the matching to each subcategory. {if isset($products)} {foreach from=$subcategories item=subcategory} <!-- display subcategory --> <span class="titulocategoria">{$subcategory.name|escape:'htmlall':'UTF-8'}</span> {if $subcategory.description} <p class="cat_desc">{$subcategory.description|truncate:50:'...'}</p> <!-- display product --> {foreach from=$products item=product name=products} <h3>{$product.name|escape:'htmlall':'UTF-8'}</h3> <p class="product_desc"> {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}</p> {/foreach} {/if} {/foreach} {/if} EXAMPLE: SUBCAT 1 Product matched to subcat1 Product matched to subcat1 Product matched to subcat2 SUBCAT2 Product matched to subcat1 Product matched to subcat1 Product matched to subcat2 I added a screenshoot to make it easier to understand. Thank you in advance! EDIT [sOLVED] Just follow this link and you will find the solution: http://www.prestashop.com/forums/topic/61907-displaying-all-products-from-subcategories-on-the-category-page/page-3?do=findComment&comment=1278016 Thanks BIgZumo Edited January 22, 2014 by Xalsina (see edit history) 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