In my app, I have a standard product which I add t...
# support
e
In my app, I have a standard product which I add to carts with differing prices depending on the situation. When that price changes, is it reasonable to change the price of the product that I have added to a cart (this is before checked out), or would it be a better idea to remove the product from the cart and add it back with the proper value in this situation? What's the best way to update the price of a line item already in a cart?
s
In some very limited use cases this might be okay but in general I'd avoid changing prices on line items entirely. As a consumer it can feel very bait-and-switchey - if I've added an item to my cart that was advertised at $10 it should stay $10. And it's very problematic if you change the price of a line item while the customer is actively checking out, as your order summary will display one total, but the customer could be charged a different total. I'd prefer to destroy carts with old line item totals if 100% necessary, or add a before_complete action that checks if line item totals are up-to-date and prevents checkout with an actionable error message if they aren't. As long as you ensure 100% that the user knows the price has changed and give them the opportunity to back out if they don't like the new price, you should be good.