Closed francoismajor closed 3 years ago
Ohh, you're changing the tax rate when you have an existing cart in progress?
I'm not really sure how we fix that, I don't really want to be recalculating the order's totals on every request for performance reasons.
Well I was just changing it period 😉 and trying to figure out why the total didn't seem to match my expected outcome. But this led me to notice that refreshing the page didn't update the totals displayed. I'm aware this is an edge case and probably shouldn't be an issue in production.
Now that the calculation is updated, it's less of an issue for me. I was just expecting the _cart to be updated on any changes. (like I mentionned, it is updated on adding a product or going to a further step) Feel free to close the issue if you think the behavior is correct.
Yeah, there's not much I can do if you change it with an active cart.
Whenever the customer updates their shipping info, adds items to the cart or just before payment, the order totals will always be recalculated so technically you could change it right before they checkout and they would pay the updated tax.
I'm going to close this as I think this is probably fine - I don't see people changing their tax rate in production mid-cart. Even if they do I think that's a fine trade-off.
Description
When changing the rate for taxes, the tax calculation is not updated on the Information page (checkout).
Expecting: tax amount to be updated on page load.
Steps to reproduce
If you go to the next step (shipping) or add a product to the cart, the tax amount will be updated. So these two actions seem to trigger a cart update(). However, the basic checkout page never updates itself.
This is noticeable with the tax rate, but leads me to wonder if all of the values are also not updated on this page.
If I change a tax rate on a production site, and a client is shopping at the same time, it could be confusing. However, going to the next step updates the amount and at least (despite the person wondering WTF) the final amount will probably be the right one.
Environment
Statamic 3.1.31 Solo Laravel 8.52.0 PHP 8.0.3 doublethreedigital/simple-commerce 2.3.14