Incorrect coupon codes accepted in basket

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
xarga
Posts: 43
Joined: 16 Dec 2019, 22:54

Incorrect coupon codes accepted in basket

Post by xarga » 13 May 2020, 04:50

Aimeos 2019.10 dev
Laravel 6
PHP 7.2

I've setup a fixed rebate coupon and limited the maximum number of coupon codes a user can enter to 2. ( I'm using one coupon slot for the recently-created Tip decorator) .

I see that the system does not completely reject an incorrect coupon code but instead stores it in the basket.

So If someone enters a wrong code then tries to correct it, they will be unable to enter the correct code because that last coupon slot has already been filled. Sure they can delete the old code but probably won't realize that's an option.

What's the best way to check whether the code is incorrect and if so, reject it instead of saving it in the basket?

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Incorrect coupon codes accepted in basket

Post by aimeos » 14 May 2020, 17:29

Yes, the current implementation doesn't remove the code from the basket:
https://github.com/aimeos/aimeos-core/b ... p#L77-L100

Maybe it's best to remove it here:
https://github.com/aimeos/aimeos-core/b ... on.php#L91
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply