Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coupon is not removed when invalid, no error message #264

Open
nvindice opened this issue Nov 18, 2021 · 5 comments
Open

Coupon is not removed when invalid, no error message #264

nvindice opened this issue Nov 18, 2021 · 5 comments

Comments

@nvindice
Copy link
Contributor

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.

@aimeos
Copy link
Owner

aimeos commented Nov 20, 2021

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.

@nvindice
Copy link
Contributor Author

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.

@aimeos
Copy link
Owner

aimeos commented Nov 22, 2021

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.

@nvindice
Copy link
Contributor Author

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? :-)

@aimeos
Copy link
Owner

aimeos commented Nov 22, 2021

Yeah and help is always appreciated :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants