2010-02-11 7 views

Respuesta

4

El siguiente debería funcionar:

$subtotal = $this->getQuote()->getSubtotal(); 
+1

Parece haber una diferencia importante entre esto y la respuesta a continuación. $ this-> getQuote() -> getSubtotal() does no incluye impuestos, pero $ totals = Mage :: getSingleton ('checkout/cart') -> getQuote() -> getTotals(); $ totals ["subtotal"] -> getValue(); incluye impuesto – Dom

27

Según this site:

que pueda obtener el subtotal con:

$totals = Mage::getSingleton('checkout/cart')->getQuote()->getTotals(); 
$subtotal = $totals["subtotal"]->getValue(); 
+0

Mi colega dice gracias :). –

+0

@NeilAitken es muy bienvenido :-) – Josh

12

intenta utilizar esto:

Mage::getSingleton('checkout/cart')->getQuote()->getSubtotal() 
+1

Para que esto funcione, es importante que las tarifas ya se hayan cobrado. Si no, la cita no tendrá el subtotal para devolver. –

+0

¡Gracias por esto! – zaw

0
$session= Mage::getSingleton('checkout/session'); 
    $getotal = Mage::helper('checkout')->getQuote()->getGrandTotal(); 
    $totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals(); //Total object 
    $subtotal = $totals["subtotal"]->getValue(); 

"$ subtotal" contendrá el valor del subtotal.

Gracias.

Cuestiones relacionadas