WordPress Woocommerce remove product programmatically

WordPress Woocommerce remove product programmatically, the proper and WORKING! way of removing a product from cart. I know you looked a lot. Found some solutions but they didn’t work.
The search is over my friend here you go.

4 responses to “WordPress Woocommerce remove product programmatically”

  1. Albert says:

    I keep getting the spinning circle when i try to remove an Item form my cart, on-and-on, when i refresh the page, the item is removed. any suggestions?

  2. Vanessa Torres says:

    I’m sorry.. Where do you actually put this code at? I mean, file.

    • metin says:

      I put it in functions.php as long as I can remember. Haven’t done wordpress in a while. You should note that this post is only for the logic of WooCommerce.
      So make sure to look for making a custom ajax call or a regular call in wordpress and use this logic in there. That means you will have to use 1 or 2 extra functions.
      I’ll post an example if I find the backup I made 2 years ago 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *