I'm building a cart system for my company which has very loose pricing options. Every customer has difference prices for all our products, and these prices will adjust based on quantity. I'm going to build a database that pulls all the pricing information out and adjusts on the site depending on who's logged in. This is down the road. Right now, I'm just working on the script that will adjust the price of items in the cart. If you visit my store you can add 3 items at 3 volume sizes. These are currently set at $20. I've created a link, that when clicked removes all the items from the cart and re-adds them at a new price of $19. This works great, the first time. If I click it again it should just run the script again and re-add them still at $19. The console seems to say this is happening, but when I open the cart sometimes 1, 2 or 3 items have simply vanished.
Is there anything totally obvious that I've missed/messed up here?
My next step is going to run this script when the add to cart button is pressed, but I wanted to get this bug out of the way first. Ideally what will happen is the item is added to the cart, it will check and see how many items are in the cart, if a price break has been reached it will remove them and re-add them according to the new price point.
view the store at http://www.integra-adhesives.com/shop/
myfoxy.js is the script I'm working on.