php - Categories not appearing in magento div -
I tried to create a side bar in Magmento using the following code:
& Lt; ? Php $ _helper1 = Dana :: Assistant ('Catalog / Category')? & Gt; & Lt ;? Php $ _categories = $ _helper1-> GetStoreCategories (wrong, true, wrong); ? & Gt; & Lt; Div class = "sidebar" & gt; & Lt; H3 & gt; Product Categories & lt; / H3 & gt; & Lt; Ul & gt; & Lt ;? Php foreach ($ __category_class here):? & Gt; & Lt; Li & gt; & Lt; A href = "& lt ;? php echo $ _helper- & gt; Mill range category ($ _ class) ;;>" & Gt; & Lt; P & gt; & Lt ;? Php echo $ _category- & gt; GetName (); ? & Gt; & Lt; / P & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt ;? Php endforeach; ? & Gt; & Lt; / Ul & gt; & Lt; / Div & gt; I have already set up my categories as default class subcategories, and I have cleared my cache and have completed the improvements given here:
I have also set this ash anchor option in yes too.
But it's still not showing anything. What's wrong with this?
Can I recommend another solution?
The best way to get the categories is by using the collection:
getUrl () ;? & gt;" & Gt; & Lt; P & gt; & Lt ;? Php echo $ _category- & gt; GetName (); ? & Gt; & Lt; / P & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt ;? Php endforeach; ? & Gt; & Lt; / Ul & gt; & Lt; / Div & gt; Maybe it can help you.
Comments
Post a Comment