Magento get cart single item price incl. tax

前端 未结 6 2223
傲寒
傲寒 2021-02-14 15:45

I have a pretty weird issue, I hope someone can help me with this.

Here are the major config settings that influence my problem:

  • Catalog prices in admin pa
6条回答
  •  渐次进展
    2021-02-14 15:56

    - Get products id, name, price, quantity, etc. present in your cart.
    - Get number of items in cart and total quantity in cart.
    - Get base total price and grand total price of items in cart.
    
    Get all items information in cart
    // $items = Mage::getModel('checkout/cart')->getQuote()->getAllItems();
    $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 "
    "; } Get total items and total quantity in cart $totalItems = Mage::getModel('checkout/cart')->getQuote()->getItemsCount(); $totalQuantity = Mage::getModel('checkout/cart')->getQuote()->getItemsQty(); Get subtotal and grand total price of cart $subTotal = Mage::getModel('checkout/cart')->getQuote()->getSubtotal(); $grandTotal = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal();

提交回复
热议问题