Using an “Auto Add to Cart” code, how would we “remove” an old item?
-
Using a code snippet from this WooCommerce page, we provide customers with a free item in the cart widget upon their arrival. All we had to do was put the product ID number in one line, and it shows up.
We went to change the product this week, and it turns out that if someone already visited previously, the old item still shows up in the cart with the new item we just put in the code. We’d like the old item to not show up.
I know that there’s probably a code that can remove the old “free” item from the cart, but I would imagine that it would need to be more than just “remove old items” so that if there are any “wish list” items from previous visits, then the wanted items would still be there, but not the old “free item”.
Is there a reference page on how to do this?
- The topic ‘Using an “Auto Add to Cart” code, how would we “remove” an old item?’ is closed to new replies.