我想根据此类别为每个产品添加一个类,或者检查此产品是否存在在此类别中并添加一些类
前任:现在我有
<div class="product-price" id="productPrice<?php echo $this->product->virtuemart_category_id ?>">
它向我展示了什么。 h34
这是类别类,但问题是有时我有多个类别,但产品只包含一个主要类别。
我需要这样的东西
如果产品 SHIRT 存在于类别 ID 77 中,请添加class="label"
一些想法?
使用此查询检查产品是否在分类中
SELECT * FROM `#__virtuemart_product_categories` WHERE `virtuemart_product_id` = <product_id> AND `virtuemart_category_id` = <category_id>