JustJohn Posted December 4, 2023 Share Posted December 4, 2023 On catalog pages, I only know of category_default_id, which has the product's main category ID, but some of my products belong in more than one category and I want to run a check on that. I've been looking at older solutions but none of them work for me. How can I pull a list of all categories for a product on catalog pages in a Smarty template? What variable should I access? Link to comment Share on other sites More sharing options...
endriu107 Posted December 4, 2023 Share Posted December 4, 2023 I think in any products listing page there isn't information about all product categories, only on default category. Link to comment Share on other sites More sharing options...
JustJohn Posted December 4, 2023 Author Share Posted December 4, 2023 Well, it is stored somewhere, right? Link to comment Share on other sites More sharing options...
Daresh Posted December 4, 2023 Share Posted December 4, 2023 Try this code: {Product::getProductCategories($product.id)|dump} 1 Link to comment Share on other sites More sharing options...
JustJohn Posted December 4, 2023 Author Share Posted December 4, 2023 3 minutes ago, Daresh said: Try this code: {Product::getProductCategories($product.id)|dump} Yep, that worked. Thank you very much! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now