Quick question — we have some assemblies on our website and the price of the assembly grows over time. Had an issue this week where a customer had added the assembly to the cart a very long time ago, and was able to checkout with the old price.
Is there a built in way to avoid this in solidus so carts always reflect the current state of pricing?
j
Jared Norman
07/28/2023, 2:25 AM
It’s easy enough to reset the prices, some stores do that when entering the checkout me stuff
k
kennyadsl
07/28/2023, 6:37 AM
another option is deleting non completed orders after a while. This will also cleanup your database with (most likely) useless orders
sg thumbs up 2
j
Jared Norman
07/28/2023, 3:16 PM
Since I literally just added this method to the line item decorator in a project, I can provide it here:
Copy code
def reset_price!
self.money_price = variant.price_for_options(pricing_options)&.money
save!
end
👌 2
Jared Norman
07/28/2023, 3:17 PM
If you were going to call this a lot you'd want to only save if it changed.
j
jakemumu
07/28/2023, 3:18 PM
Nice! Thanks yeah I like that approach I’ll add a little method on checkout to validate the line item prices