Showing posts with label Cart Items. Show all posts
Showing posts with label Cart Items. Show all posts

Tuesday, 25 June 2013

Add Multiple Items in cart in Magento


$product_id = 32;  //Here is first Product id
$warranty_id = 35;  //Here is second Product id
//You can also pass multiple product id.
$someQty = 1; //Here is quantity
//You can add different quantity for different product.


$cart = Mage::getModel("checkout/cart");
$cart->addProduct($product_id, $someQty);
$cart->addProduct($warranty_id, $someQty);
            $cart->save();