[Solved] How to delete a once added coupon again?

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
rowild

[Solved] How to delete a once added coupon again?

Post by rowild » 15 Nov 2020, 10:46

Adding a coupon works. But how can a customer delete the coupon from the basket again, in case (s)he decides differently?

In the "common/summary/detail-standard.php/" template, I set "$modify" to true. But there is another check

Code: Select all

if( ( $product->getFlags() & \Aimeos\MShop\Order\Item\Base\Product\Base::FLAG_IMMUTABLE ) == 0 )
that disables vouchers from being removed again.

This has strange consequences, here a scenario:

- customer adds some products,
- customer adds coupon (assigned to one of those products)
- customer decides differently and deletes all products again (once all products are delete, the coupon does not show up either)
- customer adds 1 other product with no coupons assigned to it
- suddenly the coupon appears again (and reduces the price, even though it is assigned to another product)

Am I doing sth wrong? How can I prevent that?
Last edited by rowild on 23 Nov 2020, 09:27, edited 1 time in total.

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

Re: How to delete a once added coupon again?

Post by aimeos » 16 Nov 2020, 10:35

There's a button for deleting the added coupons in the basket standard component if a coupon has already been added. Check for the HTML code in the original template if you've overwritten that part already in your own template.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

rowild

Re: How to delete a once added coupon again?

Post by rowild » 23 Nov 2020, 09:27

Thank you!

Post Reply