Quantcast
Channel: Themes & Design - Shopware Community Forum
Viewing all articles
Browse latest Browse all 1971

How to access the subcategories in Smarty template?

$
0
0

I want to reimplement the main menu by changing one of the built-in Shopware's .tpl files. I need to get the subcategries of each main category and so on (subcategories of a subcategory, if exists, etc.) How can I do this? I know that I have immediate access to $sMainCategories in smarty, but when I try to access subcategories by:
{foreach $sMainCategory as $mc}

{foreach $mc.subcategories as $sc}

{$sc}

{/foreach}

{/foreach}

I don't get anything, and when I output the variable {$mc.subcategories} , by using {$mc.subcategories@print_r} ,I get an empty array. I know that there are subcategories in that maincategory, and all categories and subcategories are active. Why can't I access subcategories of a category in smarty template?

 


Viewing all articles
Browse latest Browse all 1971

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>