Open vladimir-8 opened 7 months ago
Report of a little bug about the minium amount on the purchase menu. Screenshot 1 : 15 euros is displaying but most of our restaurants are 12.5 Screenshot 2 : 12.5 euros is displaying (correct amount) once I add something to the basket I noticed it can represent a friction for customers
is this still happening?
I think so. I don't remember us doing any fixes there
Describe the bug
When a customer starts an order in one restaurant; and then navigates to a different restaurant with a different minimum cart amount; minimum cart amount for the first restaurant is displayed; even if it's different for a shown restaurant
Expected behavior
Minimum cart amount for a shown restaurant should be displayed
Additional context
https://coopcycle.slack.com/archives/C4UT4DGQ3/p1711205265659789
It has to do with the way we return Cart object when a user browse a different restaurant:
https://github.com/coopcycle/coopcycle-web/blob/7a6ecdc90e789a807fdb9d3521480311adfccad0/src/Sylius/Cart/RestaurantCartContext.php#L92-L95
Be careful: A simple fix like replacing a Restaurant will break the code that detects that a user started a cart in another restaurant.