Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $params['product']=$productid;
- $params['super_group'] = array( $simpleid=> $qty );
- $cart = Mage::getModel('checkout/cart'); //Get cart object
- $cart->init();
- $cart->addProduct($productid, $params);
- $cart->save();
- $cartHelper = Mage::helper('checkout/cart');
- $cartHelper->getCart()->removeItem($simpleproductcartid)->save();
- $cartHelper->getCart()->updateItem($somecartrowid, $params)->save();
- {"name":"Amigne 2012", "type":"grouped", "parent_id":"635", "entity_id":"567", "qty":3}
- "567":{"cartid":"1000","qty":3},
- $cart->updateItem('1000',1)
- {"name":"Amigne 2012", "type":"simple", "parent_id":"", "entity_id":"567", "qty":1}
- "567":{"cartid":"1002","qty":1}
- public function updateItem($itemId, $buyRequest, $params = null)
- * @param int $itemId
- * @param Varien_Object $buyRequest
- * @param null|array|Varien_Object $params
- * @return Mage_Sales_Model_Quote_Item
- public function addParamsToBuyRequest($buyRequest, $params)
- * $params holds parameters of what operation must be performed:
- * - 'current_config', Varien_Object or array - current buyRequest that configures product in this item,
- * used to restore currently attached files
- * - 'files_prefix': string[a-z0-9_] - prefix that was added at frontend to names of file inputs,
- * so they won't intersect with other submitted options
- *
- * @param Varien_Object|array $buyRequest
- * @param Varien_Object|array $params
- * @return Varien_Object
- $cartdata[988][qty]=100
- $cartdata[999][qty]=1
- $cartdata[1001][qty]=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement