Last active
May 18, 2016 16:37
-
-
Save refaelgold/bb07afb601afb72a82f89805c893da61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->getOnepage()->getQuote()->getShippingAddress(); | |
$this->getOnepage()->getQuote()->setTotalsCollectedFlag(false); | |
$this->getOnepage()->getQuote()->collectTotals();//i think this is right | |
$this->getOnepage()->getQuote()->save() | |
$subtotal = Mage::getSingleton('checkout/session')->getQuote()->getGrandTotal() - Mage::getSingleton('checkout/session')->getQuote()->getShippingAmount(); | |
//magento 1.8+ | |
$totals = Mage::getSingleton('checkout/cart')->getQuote()->getTotals() | |
$totalKeys = array('subtotal', 'shipping', 'tax', 'discount', 'grand_total'); | |
foreach ($totalKeys as $totalKey) { | |
if (isset($totals[$totalKey])) echo $totals[$totalKey]->getData('value'); | |
} | |
$shipping = Mage::getSingleton('checkout/cart')->getQuote()->getTotals()['shipping']->getValue(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment