How to remove Configurable Product from cart list

Kuldeep Singh

I add configurable product into cart successfully now How I remove this configurable product from cart list .

Jacob
/** @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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Get Simple Product from Configurable in Cart

From Dev

How to specify what "list" the product was added to cart from? Enhanced Ecommerce

From Java

Remove specific product variation from cart in WooCommerce

From Dev

Remove Dependency of attributes in configurable product

From Dev

how to remove compare product and my cart from right side bar in magento

From Dev

Remove attributes from product links in cart (Woocommerce - get_permalink)

From Dev

Auto add or remove a freebie product from cart in Woocommerce

From Dev

Remove attributes from product links in cart (Woocommerce - get_permalink)

From Dev

How to redirect a associated product to its configurable product

From Dev

How to remove Shipping from Woocommerce cart?

From Dev

How to check if Configurable Product is out of stock?

From Dev

Magento - How to add extra button like "Add to cart" and Redirect to external url from grid view, list view and product page view.

From Dev

unable to create add cart button in magento in product listing page for configurable product

From Dev

How to create a new product from a custom form and then add it to the cart?

From Dev

Magento : How to Get product from cart and add it again

From Dev

How to add product in cart from SalesRule_Model_Validator in magento

From Dev

How to set unique price for each simple product for configurable product

From Dev

How to use Simple product images for Configurable product images?

From Dev

How to remove Price from Product Category page?

From Dev

How do remove Add To Cart button after a product is added in woo-commerce?

From Dev

How to refresh the page and remove delete product, when click on delete button in dropdown cart on header in opencart

From Dev

Simple product inside configurable product

From Dev

How to remove shipping options from shopping cart based on which products are in the cart and what shipping options are linked to these products

From Dev

WooCommerce Delete all products from cart and add current product to cart

From Dev

WooCommerce Delete all products from cart and add current product to cart

From Dev

OpenCart remove option from cart

From Dev

Remove from Cart is not Working in AngularJS

From Dev

OpenCart remove option from cart

From Dev

Ajax delete product from cart in magento

Related Related

  1. 1

    Get Simple Product from Configurable in Cart

  2. 2

    How to specify what "list" the product was added to cart from? Enhanced Ecommerce

  3. 3

    Remove specific product variation from cart in WooCommerce

  4. 4

    Remove Dependency of attributes in configurable product

  5. 5

    how to remove compare product and my cart from right side bar in magento

  6. 6

    Remove attributes from product links in cart (Woocommerce - get_permalink)

  7. 7

    Auto add or remove a freebie product from cart in Woocommerce

  8. 8

    Remove attributes from product links in cart (Woocommerce - get_permalink)

  9. 9

    How to redirect a associated product to its configurable product

  10. 10

    How to remove Shipping from Woocommerce cart?

  11. 11

    How to check if Configurable Product is out of stock?

  12. 12

    Magento - How to add extra button like "Add to cart" and Redirect to external url from grid view, list view and product page view.

  13. 13

    unable to create add cart button in magento in product listing page for configurable product

  14. 14

    How to create a new product from a custom form and then add it to the cart?

  15. 15

    Magento : How to Get product from cart and add it again

  16. 16

    How to add product in cart from SalesRule_Model_Validator in magento

  17. 17

    How to set unique price for each simple product for configurable product

  18. 18

    How to use Simple product images for Configurable product images?

  19. 19

    How to remove Price from Product Category page?

  20. 20

    How do remove Add To Cart button after a product is added in woo-commerce?

  21. 21

    How to refresh the page and remove delete product, when click on delete button in dropdown cart on header in opencart

  22. 22

    Simple product inside configurable product

  23. 23

    How to remove shipping options from shopping cart based on which products are in the cart and what shipping options are linked to these products

  24. 24

    WooCommerce Delete all products from cart and add current product to cart

  25. 25

    WooCommerce Delete all products from cart and add current product to cart

  26. 26

    OpenCart remove option from cart

  27. 27

    Remove from Cart is not Working in AngularJS

  28. 28

    OpenCart remove option from cart

  29. 29

    Ajax delete product from cart in magento

HotTag

Archive