Note that there are some explanatory texts on larger screens.

plurals
  1. POCS Cart show products in category list
    text
    copied!<p>I have a project on CS Cart / Smarty and I would like to generate the list of a category's products in the category list, under the active category. </p> <p>So far the code of <code>categories_tree.tpl</code> prints the categories only and looks like this:</p> <pre><code>{* $Id$ *} {assign var="cc_id" value=$smarty.request.category_id|default:$smarty.session.current_category_id} {foreach from=$categories item=category key=cat_key name="categories"} {if $category.level == "0"} {if $ul_subcategories == "started"} &lt;/ul&gt; {assign var="ul_subcategories" value=""} {/if} &lt;ul class="menu-root-categories tree"&gt; &lt;li&gt; &lt;a href="{"categories.view?category_id=`$category.category_id`"|fn_url}" {if $category.category_id == $cc_id} class="active"{/if}&gt;{$category.category}&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; {else} {if $ul_subcategories != "started"} &lt;ul class="menu-subcategories"&gt; {assign var="ul_subcategories" value="started"} {/if} &lt;li&gt;&lt;a href="{"categories.view?category_id=`$category.category_id`"|fn_url}"{if $category.category_id == $cc_id} class="active"{/if}&gt;{$category.category}&lt;/a&gt;&lt;/li&gt; {if $category.category_id == $cc_id} &lt;div class = "cat_prod" style = "display: none;"&gt; testing &lt;/div&gt; {/if} {/if} {if $smarty.foreach.categories.last &amp;&amp; $ul_subcategories == "started"} &lt;/ul&gt; {/if} {/foreach} </code></pre> <p>I need to make a <code>&lt;ul&gt;</code> of the active category's products inside the <code>cat_prod</code> div. How do I compose the <code>foreach</code> in order to get the products of that category?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload