cancel
Showing results for 
Search instead for 
Did you mean: 

Magento, change checkout/cart quote price

SOLVED

Magento, change checkout/cart quote price

Hello,

I'm working in app/design/frontend/<theme>/template/checkout/cart.phtml

And i can get the different prices of my product, but i can't change it.
My code:

$quote = Mage::getSingleton('checkout/session')->getQuote();

$quote->setBaseSubtotal('666666');
$quote->setGrandTotal('666666');
$quote->setBaseGrandtotal('666666');
$quote->setSubtotal('666666');
$quote->setBaseSubtotal('666666');
$quote->setSubtotalWithDiscounts('666666');
$quote->setBaseSubtotalWithDiscounts('666666');

$quote->save();

And when i do:

$quote->getBaseSubtotal();

It's returned me the correct price, but i can't see it in the frontend.
What i'm doing bad? There's another way?

Thanks for any help

Tags (3)
2 REPLIES

Re: Magento, change checkout/cart quote price

I can change the prices of the table doing:

 

$_item->setPrice('8888888');
$_item->setBasePrice('8888888');
$_item->setRowTotal('8888888');
$_item->setBaseRowTotal('8888888');
$_item->setBaseCalculationPrice('8888888');
$_item->setCalculationPrice('8888888');
$_item->setConverted_price('8888888');
$_item->setBaseOriginalPrice('8888888');
$_item->setTaxableAmount('8888888');
$_item->setBaseTaxableAmount('8888888');
$_item->setoriginalPrice('8888888');
$_item->setSubtotalWithDiscount('8888888');
$_item->setBaseSubtotalWithDiscount('8888888');

$_item->setPriceInclTax('9999999');
$_item->setBasePriceInclTax('9999999');
$_item->setRowTotalInclTax('9999999');
$_item->setBaseRowTotalInclTax('9999999');
$_item->setBaseGrandTotal('9999999');

But, i really need to calculate all again.

 

I want to add some special products that have options (checkbox) that have options (dropdown), and Magento calculate all except the dropdown option, so i tried to add it by my own.

Re: Magento, change checkout/cart quote price

Hello,

 

For all with the same problem, i can do it works with: 

$_item->setPrice($newPrice);
$_item->setPriceInclTax($newPrice);
$_item->save();

I know it's the same that i did before. Except all the other prices sets that i remove beacuse, first, i don't need it, and second, maybe it will give me problems in the future.

 

Why it works now?, i admit i don't know, maybe the format of the price (double).