Title: Programmatically remove item from cart
Last modified: August 30, 2016

---

# Programmatically remove item from cart

 *  Resolved [PaulH](https://wordpress.org/support/users/paulhuckstepp/)
 * (@paulhuckstepp)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/programmatically-remove-item-from-cart/)
 * Is it possible, and if so how, to remove an item from the visitors cart?
 * I have a site where if the cart value is above a certain amount the user can 
   select a free gift, the problem is the user can then adjust their basket to a
   point where they no longer qualify for the gift but it’s still in their cart.
 * Thanks in advance.
 * [https://wordpress.org/plugins/jigoshop/](https://wordpress.org/plugins/jigoshop/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Jigoshop Support-Vasili](https://wordpress.org/support/users/vasiliborbis/)
 * (@vasiliborbis)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/programmatically-remove-item-from-cart/#post-6473207)
 * Hi paulhuckstepp,
 * Could you post your site url?
 *  Thread Starter [PaulH](https://wordpress.org/support/users/paulhuckstepp/)
 * (@paulhuckstepp)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/programmatically-remove-item-from-cart/#post-6473221)
 * The site is live and has been for quite a while: [http://www.emptybox.co.uk](http://www.emptybox.co.uk)
 * I’m not sure looking at the site will help.
 *  [Jigoshop Support-Vasili](https://wordpress.org/support/users/vasiliborbis/)
 * (@vasiliborbis)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/programmatically-remove-item-from-cart/#post-6473315)
 * Hi Paul,
 * You could set the quantity of cart to 0 by editing the “jigoshop_cart_calss.php”
   file, go to jigoshop/classes and open the file “jigoshop_cart_calss.php” at line
   399 change the value of $quantity variable to 0. Probably it will help.
 *  Thread Starter [PaulH](https://wordpress.org/support/users/paulhuckstepp/)
 * (@paulhuckstepp)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/programmatically-remove-item-from-cart/#post-6473316)
 * I not sure that I’ve explained what I’m trying to do properly.
 * When a visitor adds a certain amount to their cart a list of free gift products
   is shown (products with a 0.00 price) they can then add one of those to their
   cart.
 * This all works now.
 * However, if the user removes one of the normal products from their cart they 
   may no longer qualify for the free gift and so I need to be able to remove it
   from their cart. This I can’t find a solution for at the moment.
 * I have a feeling it might be something I can do by iterating through the cart
   before the checkout page is built. Perhaps using the action for the jigoshop 
   wrapper?
 *  [Jigoshop Support-Vasili](https://wordpress.org/support/users/vasiliborbis/)
 * (@vasiliborbis)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/programmatically-remove-item-from-cart/#post-6473333)
 * Paul,
 * Now I see what you mean 🙂 You need to delete a gift when user is deleting a 
   product from basket, It could be possible by editing the source files of Jigoshop,
   let me check and I will let you know how.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Programmatically remove item from cart’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jigoshop_655549.svg)
 * [Jigoshop](https://wordpress.org/plugins/jigoshop/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jigoshop/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jigoshop/)
 * [Active Topics](https://wordpress.org/support/plugin/jigoshop/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jigoshop/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jigoshop/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Jigoshop Support-Vasili](https://wordpress.org/support/users/vasiliborbis/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/programmatically-remove-item-from-cart/#post-6473333)
 * Status: resolved