Magento可能会获得总的愿望物品
是否有一种简单的方法/功能来接收愿望列表中的产品总数?类似的方法可以工作Magento可能会获得总的愿望物品,magento,Magento,是否有一种简单的方法/功能来接收愿望列表中的产品总数?类似的方法可以工作 public function getWishListTotal($customer) { $wishList = Mage::getSingleton('wishlist/wishlist')->loadByCustomer($customer); $wishListItemCollection = $wishList->getItemCollection(); $wishListTotal=0; fore
public function getWishListTotal($customer) {
$wishList = Mage::getSingleton('wishlist/wishlist')->loadByCustomer($customer);
$wishListItemCollection = $wishList->getItemCollection();
$wishListTotal=0;
foreach ($wishListItemCollection as $_item) {
$_product = $_item->getProduct();
$wishListTotal = $wishListTotal + $_product->getPrice()
}
return $wishListTotal;
}
这是愿望清单上项目的总价,不含税、运费等