I add configurable product into cart successfully now How I remove this configurable product from cart list .
/** @var Mage_Sales_Model_Quote $quote */
$quote = Mage::getModel('sales/quote');
$quote = $quote->load($data['quote_id']);
if(!$quote->getId()) {
return "No quote found";
}
//$productId should be the productId of the config product.
$productId = $data['config_product_id'];
if(!$quote->hasProductId($productId)) {
return 'Product does not exist in the cart';
};
foreach($quote->getAllItems() as $item) {
if($item->getProductId() == $productId) {
$quote->removeItem($item->getId());
break;
}
}
$quote->save();
Had the same issue, this is how i resolved it.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments