I'm manually adding some products to the cart:

$product = Mage::getModel('catalog/product')->load(113);
$params = array(
  'product' => 113,
  'qty' => 1
$request = new Varien_Object();
$cartHelper->getCart()->addProduct($product, $request); 

But the price is always empty (or null).

I've been debugging the execution through


and finally:

protected function _addCatalogProduct(Mage_Catalog_Model_Product $product, $qty = 1)
    $newItem = false;
    $item = $this->getItemByProduct($product);
    if (!$item) {
        $item = Mage::getModel('sales/quote_item');
        if (Mage::app()->getStore()->isAdmin()) {
        else {
        $newItem = true;

     * We can't modify existing child items
    if ($item->getId() && $product->getParentProductId()) {
        return $item;


    // Add only item that is not in quote already (there can be other new or already saved item
    if ($newItem) {

    return $item;

But the price is not there, in that $item :(

Any help would be much appreciated.

2 Answers 2


The price in a quote item is set in \Mage_Sales_Model_Quote::collectTotals

So you need to run \Mage_Sales_Model_Quote::collectTotals to have a price, this happens when a page is rendered, after reload.

You can run this manually, but be careful, unfortunately the method stores a bunch of cached prices, which may be reused in a wrong way and might lead to wrong prices if called twice!


Along with the suggested below collectTotals() call please try to set store id to the product before load. $storeId = Mage::app()->getStore()->getId(); $product = Mage::getModel('catalog/product') ->setStoreId($storeId) ->load(113);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.