THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Bonjour, une idée peut-être
avec ce code tous les produits de ces catégories s'affichent dans toutes les catégories
je souhaite afficher les produits aux rubriques correspondantes bien entendu
j'ai du oublié un truc
Bien à vous

 <ul class="nav navbar-nav navbar-categories">
                {loop type="category" name="product-category-navigation" parent="0" need_count_child="yes" }
                {if $CHILD_COUNT > 0}
                    <li class="dropdown">
                        <a href="{$URL}" class="dropdown-toggle">{$TITLE}</a>
                        <ul class="dropdown-menu" role="menu">
                            {loop type="category" name="sub-cat-product" parent="{$ID}" need_product_count="yes"}
                                <li><a href="{$URL}">{$TITLE}</a>
								
					<ul>
					{loop type="product" name="category-product" parent="{$ID}" depth="2" }
					{if $CHILD_COUNT > 0}
					     <li>
						<a href="{$URL}">{$TITLE}</a>
					    </li>
					{/if}
					{/loop}
					</ul>
								
				</li>    
                            {/loop}
                        </ul>
                    </li>
                {else}
                    <li class="dropdown"><a href="{$URL}">{$TITLE}</a></li>
                {/if}
                {/loop}
            </ul>

Last edited by stephst84 (24-05-2019 09:25:07)

Offline


{loop type="product" name="category-product" parent="{$ID}" depth="2" }

Il n'existe pas de paramètre "parent" dans la boucle product. Utilise "category" ou "category_default" : http://doc.thelia.net/en/documentation/ … oduct.html

Par ailleurs la notation parent="{$ID}" est inutile. parent={$ID} marche très bien. Idem pour depth="2", qui s'écrit plutôt depth=2


OpenStudio Toulouse

Offline


merci pour les compléments d'info
Voilà le code utilisé et fonctionnel

 <ul class="nav navbar-nav navbar-categories">
       {loop type="category" name="product-category-navigation" parent="0" need_count_child="yes" need_product_count="yes" }
       {if $CHILD_COUNT > 0}
          <li class="dropdown">
           <a href="{$URL}" class="dropdown-toggle">{$TITLE}</a>
                <ul class="dropdown-menu" role="menu">
                 {loop type="category" name="sub-cat-product" parent="{$ID}" }
			{if $PRODUCT_COUNT > 0}
                         <li><a href="{$URL}">{$TITLE}</a>
								
			<ul>
			{loop type="product" name="category-product" category=$ID depth=2 }
				<li>
				<a href="{$URL}">{$TITLE}</a>
				</li>
                       {/loop}
			</ul>
			</li>
			{/if}
                   {/loop}
                 </ul>
         </li>
        {else}
         <li class="dropdown"><a href="{$URL}">{$TITLE}</a>
	</li>
 {/if}
 {/loop}
</ul>

Last edited by stephst84 (24-05-2019 14:41:40)