- 🇨🇭Switzerland znerol
See also ✨ Add an option to disable the add to cart message on a certain order type Fixed .
- last update
over 1 year ago 785 pass - Status changed to Needs work
over 1 year ago 9:02am 16 June 2023 - 🇮🇱Israel jsacksick
I don't think we can commit this... I mean, I don't think we can decide to not display the add to cart message on the simple fact that the current request is an ajax request? What if you want to display the message and the Drupal messages are shown in a div somewhere?
- 🇩🇪Germany Anybody Porta Westfalica
@jsacksick: This is blocking contrib modules like commerce_add_to_cart_confirmation from providing a clear replacement and there doesn't seem to be a clean way to disable this message, if "someone else cares for the confirmation" yet?
And the "Add to cart confirmation" still is kind of basic in Drupal commerce, so it might make sense to solve this finally.I totally agree with you in #12 that it might be too risky to just rely on the AJAX request, that might have unwanted side effects.
So the question is, what would you suggest implementing in commerce to fix issues like #3476771: Regular "XYZ has been added to cart" Drupal message still appears additionally → in contrib cleanly? Our team could help then getting this done, once a decision was made, how it should be done.
I already thought about a simple general setting like "Show confirmation message after adding a product to cart", which would allow users to simple disable or enable the confirmation message in general?
- 🇩🇪Germany Anybody Porta Westfalica
I finally found there's already a setting to disable the default commerce add to cart message!
You can disable it in your order type(s):
/admin/commerce/config/order-types/default/edit
See: #3476771: Document how to switch off Regular "XYZ has been added to cart" confirmation →So if this is particular for AJAX requests and it's not the goal to disable the message in general, you can proceed here.
If the setting is good enough, this can be closed.