Skip to content

Instantly share code, notes, and snippets.

@refaelgold
Last active May 18, 2016 16:37
Show Gist options
  • Save refaelgold/bb07afb601afb72a82f89805c893da61 to your computer and use it in GitHub Desktop.
Save refaelgold/bb07afb601afb72a82f89805c893da61 to your computer and use it in GitHub Desktop.
$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