aimeos / aimeos-core

Aimeos PHP e-commerce framework for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce

Home Page:https://aimeos.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coupon is not removed when invalid, no error message

nvindice opened this issue · comments

When a coupon code is entered but invalid (eg. because the basket decorator does not fit requirements), no error message is displayed. The code just becomes part of the basket but does not have any effect on the basket value.

IMHO it would make more sense to explain the problem to the user like it happened in 2018.10 so the user can enter another coupon code or change his basket contents.

Same thing happens when the coupon code gets invalid because the basket content changed - the user may not even recognize the coupon is no longer valid. The invalid coupon code should be removed from the basket (IMHO) or at least the user should see a note explaning to problem.

Main problem is that Aimeos has no system for passing warning messages to the frontend and providers can only throw exceptions to display errors. But throwing an exception always stops of the rest of the code which should be executed nevertheless in case of a warning.

I see. Is there any way to get access to the view object in the plugin? This would be a very simple way to pass error messages.

Don't think so. You can get a view object from the context but it's not the view object used by the HTML client.

Yes, I've noticed that. In our case, we will just go back to the 2018.x version and throw an exception (which seems to work fine here). However, this seems to be a good candidate for a 2022 feature? :-)

Yeah and help is always appreciated :-)