Minicart 产品数量显示 Magento
Minicart product amount display Magento
我有一个关于迷你购物车的问题,例如:如果我的购物车中有 3 件独特的产品,每件 30 件,迷你购物车显示的总数量为 90。
我怎样才能让 minicart 显示唯一产品的数量,所以只有 3 个?
将代码中的 $this->getSummaryCount()
替换为 Mage::helper('checkout/cart')->getItemsCount();
。
app/design/frontend/your_theme/default/template/checkout/cart/minicart.phtml
$_cartQty = Mage::helper('checkout/cart')->getItemsCount();
if(empty($_cartQty)) {
$_cartQty = 0;
}
我有一个关于迷你购物车的问题,例如:如果我的购物车中有 3 件独特的产品,每件 30 件,迷你购物车显示的总数量为 90。
我怎样才能让 minicart 显示唯一产品的数量,所以只有 3 个?
将代码中的 $this->getSummaryCount()
替换为 Mage::helper('checkout/cart')->getItemsCount();
。
app/design/frontend/your_theme/default/template/checkout/cart/minicart.phtml
$_cartQty = Mage::helper('checkout/cart')->getItemsCount();
if(empty($_cartQty)) {
$_cartQty = 0;
}