0

是否有一种简单的方法/功能来接收愿望清单中产品的总计?

4

1 回答 1

0

像这样的东西可以工作

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;   
}  

这是愿望清单上商品的总价格,不含税、运费等。

于 2012-04-23T09:40:14.540 回答