Ive got an issue where grouped products are not being recognized as the same thing as the downloadable product being added to the cart which makes different cart items instead of just increasing the quantity on the last cart item.
So just to explain that a bit more:
- Grouped Product (sku: dog-stuff)
- Downloadable Product linked to group product (sku: dog-bone)
I then programmatically add dog-bone to the cart..
My Cart shows:
- dog-bone from grouped product
- dog-bone from downloadable product
Hopefully that makes sense. Im trying to get them to group as the same cart item with a quantity of 2 instead of seperate items..
Here is my code to add product to cart..
$sku = isset($_POST['sku']) ? $_POST['sku']:null;
if(is_null($sku)){
echo json_encode(false);
exit;
}
$storeId = Mage::app()->getStore()->getId();
$product = Mage::getModel('catalog/product')->load(Mage::getModel('catalog/product')->getIdBySku($sku))->setStoreId($storeId);
$qty = 1;
$quote = Mage::getSingleton('checkout/session')->getQuote();
$item = $quote->addProduct($product, $qty);
$quote->save();