VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: EIF on May 02, 2022, 20:15:12 PM

Title: How to echo product category on product detail page
Post by: EIF on May 02, 2022, 20:15:12 PM
Hi,

Do anyone please tell me the php code to echo the product category of the currunt product on the detail page? Prefer the forced conical preference category.

Using Virtuemart 3.8.8
Title: Re: How to echo product category on product detail page
Post by: Milbo on May 07, 2022, 23:52:54 PM
use the vmdebug. Enable it in the vm config
go in the template, where you see your product for example as $product and use vmdebug('my product',$product); categories keeps all the ids... and I think category or something similar, should have the category you are browsing the product. You may try. vmdebug('my product',$product->categoryItem); or use the canonCatId and use the category model to load it