Add custom "Option" to Coupon - how to retrieve in checkout?

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!
cyrotek
Posts: 58
Joined: 27 Jun 2019, 16:43

Add custom "Option" to Coupon - how to retrieve in checkout?

Post by cyrotek » 29 Jul 2019, 12:12

Hello,

for a customer we have setup the shop to buy online courses, now he wants to define bonus courses that one will get if he uses a certain coupon. I figured I'd just add an option like "addCourse" to the coupon and store the id of the course, but how do i retrieve that option in the checkout process to display to the customer that he will get that course on top??

Regards

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

Re: Add custom "Option" to Coupon - how to retrieve in checkout?

Post by aimeos » 29 Jul 2019, 16:32

The simplest way is to use the "Present" coupon provider and define the additional product as free of charge product:
https://aimeos.org/docs/User_Manual/Adm ... st#Present
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cyrotek
Posts: 58
Joined: 27 Jun 2019, 16:43

Re: Add custom "Option" to Coupon - how to retrieve in checkout?

Post by cyrotek » 30 Jul 2019, 07:23

Usually a good way, however, the course is not purchasable or a product at all, its one course just made for a specific range of customer.

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

Re: Add custom "Option" to Coupon - how to retrieve in checkout?

Post by aimeos » 30 Jul 2019, 07:37

It's OK that it is not purchaseable but if you sell courses, the bonus course should be a hidden product too. This way, customers can enter the code and the course will be shown in the basket without charge (set price to 0.00).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cyrotek
Posts: 58
Joined: 27 Jun 2019, 16:43

Re: Add custom "Option" to Coupon - how to retrieve in checkout?

Post by cyrotek » 30 Jul 2019, 08:40

Can I make the present dependend on the coupon that is added? Cause it'll have various courses in the near future that will be gifted that way, hence i considered and still consider the Coupon Option the easiest and most flexible solution...

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

Re: Add custom "Option" to Coupon - how to retrieve in checkout?

Post by aimeos » 30 Jul 2019, 08:42

Sure. Create one coupon entry for each course and associate the appropriate coupon code to each entry
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cyrotek
Posts: 58
Joined: 27 Jun 2019, 16:43

Re: Add custom "Option" to Coupon - how to retrieve in checkout?

Post by cyrotek » 30 Jul 2019, 12:39

Still, there gotta be a way to access the coupon options... Instead of having to add each and every course, a coupon and what not, i would still prefer to simply add an option to a coupon that holds the courses associated.

Whats the way to achieve that?

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

Re: Add custom "Option" to Coupon - how to retrieve in checkout?

Post by aimeos » 31 Jul 2019, 08:35

You can extend the coupon or coupon code table, item and manager to store that additional information and extend the admin interface to manage it but this is going to be some work.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cyrotek
Posts: 58
Joined: 27 Jun 2019, 16:43

Re: Add custom "Option" to Coupon - how to retrieve in checkout?

Post by cyrotek » 31 Jul 2019, 11:46

Why cant I just hijack the Options and add my own? Thats there and should be used somewhere, I just need to know which method loads the options so i can load it and access it.

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

Re: Add custom "Option" to Coupon - how to retrieve in checkout?

Post by aimeos » 31 Jul 2019, 19:19

You can but you have to care yourself how your customers get access to that courses.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply