So I would like to create a function in the theme functions.php file that triggers after the first step of the ticket selection has been done. The goal is that if a certain condition has been met, that a predefined coupon is applied. Something that would look like this in code:
We don’t currently have an option to apply a promo code to the cart in the way you are requesting above as it is expected to go through he promotions add-on.
It would be possible to add the promotions but you would need to create a custom function to apply the promotions to the transaction, we don’t have a function/method you can pass a promotion code to which would then apply the promotion for you outside of the promotions add-on itself.
I can only apologise for the delay during the new year holidays. During Christmas and New Year we all spend a little time with our families so response times are a little longer than usual.
In any case, I’m glad you’ve found a solution.
Viewing 5 reply threads
The support post ‘Programmatically apply a coupon’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.