Including list of categories as subpart of products-default
Posted: 27 Mar 2017, 05:29
I've been searching and searching and, I believe I've just confused myself. Before I hack something together I'd like a more elegant, upgrade-proof solution. What I am trying to do is essentially add a new subpart to Catalog\Lists\Items or, more specifically,
client\html\templates\common\partials\products-default.php
Endgame: This subpart would essentially output a div with the first category name as its' contents -- between the media and text subparts.
At this point I am figuring I should be returning the html via the subpart getBody method but I'm at a loss for how to actually get the categories. I could also easily accomplish this simply by overriding the products-default template but I'm not sure the best way to query and add the categories to the productItems so they'd be available to me there.
Any help with the best way to accomplish this would be greatly appreciated.
client\html\templates\common\partials\products-default.php
Endgame: This subpart would essentially output a div with the first category name as its' contents -- between the media and text subparts.
At this point I am figuring I should be returning the html via the subpart getBody method but I'm at a loss for how to actually get the categories. I could also easily accomplish this simply by overriding the products-default template but I'm not sure the best way to query and add the categories to the productItems so they'd be available to me there.
Any help with the best way to accomplish this would be greatly appreciated.