aimeos / aimeos-core

Aimeos PHP e-commerce framework for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
https://aimeos.org
Other
3.4k stars 118 forks source link

Problem with invalid coupon codes #172

Closed nvindice closed 5 years ago

nvindice commented 5 years ago

Aimeos version: 2018.x-dev

Hi Aimeos team,

I experience a problem with coupon codes. When I enter an invalid code, I get the according error message. But when I click on "Check basket" afterwards, the invalid coupon code does not get deleted, but remains and the error message is displayed again. I am neither able to remove the invalid coupon code (as it is not displayed) nor can I continue with checkout (because my only option remains to click the "Check basket" button).

I traced this back - the function \Aimeos\MShop\Coupon\Provider\Base->updateCoupon() is not called, but the function Aimeos\MShop\Plugin\Provider\Order->update() is. There, the coupon code gets detected as invalid, but is not removed.

This problem does not occur in the demo shop. I removed all custom coupon provides, but the problem remains. Do you have any idea?

aimeos commented 5 years ago

Would expect that one of these conditions fail and the coupon isn't added to the basket at all: https://github.com/aimeos/ai-controller-frontend/blob/2018.10/controller/frontend/src/Controller/Frontend/Basket/Standard.php#L341-L354

nvindice commented 5 years ago

Perfect! You pointed me to the right solution. Thank you!!