Coupon type as Voucher

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
traiyani75
Advanced
Posts: 114
Joined: 08 Nov 2019, 11:56

Coupon type as Voucher

Post by traiyani75 » 20 May 2022, 10:01

Hello, we are using voucher as coupon type .
We created voucher product and define price for that. Later we have added that voucher product sku code into coupon's voucher.productcode. Screenshot attached.

Now, we need to use that coupon in api level, When we try that coupon while checkout, it is giving us error like "No bought voucher for code "#coupon" available". Will you pls help me to sort this out?

thanks
Attachments
4.png
4.png (65.11 KiB) Viewed 1205 times
3.png
3.png (50.01 KiB) Viewed 1205 times
2.png
2.png (48.31 KiB) Viewed 1205 times
1.png
1.png (57.77 KiB) Viewed 1205 times

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

Re: Coupon type as Voucher

Post by aimeos » 21 May 2022, 20:46

The "Voucher" product type is only for selling gift cards which can be redeemed afterwards. It also checks for the ordered voucher and that is the reason why you get this error message.

If you do not want to sell gift cards, use the FixedRebate (or PercentRebate) coupon provider instead.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

traiyani75
Advanced
Posts: 114
Joined: 08 Nov 2019, 11:56

Re: Coupon type as Voucher

Post by traiyani75 » 24 May 2022, 05:49

I want to create voucher of 500QR. And it will be with reduction technique.
Like user can use voucher for 100QR purchase, and rest 400QR will still available with voucher. which user can redeem on next purchase.

How do I prepare it? As per documentation, voucher type coupon is providing such functionality

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

Re: Coupon type as Voucher

Post by aimeos » 25 May 2022, 15:22

Like said, this is only possible for vouchers the customer has bought, not for a coupon code you just send to your customer.

To get what you want, you need to create a new coupon provider (you can copy and adapt the "Voucher" coupon provider) which doesn't check the for the ordered voucher:
https://github.com/aimeos/aimeos-core/b ... hp#L80-L85
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply