$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems(); //获取所有的信息集合
foreach($items as $item) {
echo 'ID: '.$item->getProductId().'';
echo 'Name: '.$item->getName().'';
echo 'Sku: '.$item->getSku().'';
echo 'Quantity: '.$item->getQty().'';
echo 'Price: '.$item->getPrice().'';
echo "";
}
//获取产品的数量
$totalItems = Mage::getModel('checkout/cart')->getQuote()->getItemsCount();
$totalQuantity = Mage::getModel('checkout/cart')->getQuote()->getItemsQty();
//获取产品的价格
$subTotal = Mage::getModel('checkout/cart')->getQuote()->getSubtotal();
$grandTotal = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal();
(责任编辑:最模板) |