- Issue created by @Anybody
- 🇮🇳India kulpratap2002
@anybody i try to change the summed amount on the basis of the newly added product in the cart , i think the issue is not in the commerce_add_to_cart module the issue is in the cart module which is a sub module of the commerce module, since the commerce module is tha parent module of the commerce_add_to_cart module it is taking data like 'total_price' from the OrderTotal and other files of the commerce module, so the issue is not in this module.
- Assigned to TomTech
- Status changed to Closed: works as designed
about 1 month ago 7:15am 10 March 2025 - 🇺🇸United States TomTech
Hi and thanks for the report!
A few things to note here:
1. This has been the default behavior for ~12+ years, going back to D7. It is really a sample, though. You aren't locked into the view or the template.
2. This can get really complicated to try and handle OOTB, depending on the merchant requirements. Some examples:
If there is a max quantity of 10 for an item, there are currently 8 items in the cart, and the customer attempts to add 4 more, your site might only allow an increase of 2, not the 4 that was attempted.
If you are displaying price, and the price changes when quantity is increased, which price should be displayed? The base price from the product? Or the calculated price on the order item?
A simple way to avoid many of these issues, is to simply display the product that was added, and not display the price or quantity in the message. (Allow the cart to handle displaying the complexities of price/quantity/extended price/adjustments, etc...)
3. Fortunately, the dialog renders a view in a template. Customizations can be achieved by modifying the view. Advanced changes can be achieved by overriding the template in your theme.
- 🇩🇪Germany Anybody Porta Westfalica
Thanks for your feedback and suggestions @tomtech! :)