Posted: June 11, 2019 at 6:09 am
We are offering two classes, and want to give a discount or have a code that’s applied ONLY if people register in BOTH.
Is this possible to do in EE4? It’s the only two courses we’re offering over the summer, so I’m hoping EE4’s promo codes can use some logic to detect that two classes are being purchased to make the code valid, OR that the code could detect that the dollar value being purchased is over a certain amount, and apply itself then.
Hopefully this is making sense!
Currently, the Promotions add-on does not have this functionality.
Having said that if you are comfortable with PHP it wouldn’t be all that difficult to do the above with a snippet of code, its not going to work with every single use case but you could do something similar to what this snippet does:
That doesn’t do what you are requesting here, it simply checks if there are any promotions that apply to the current events in the cart and if not, removes the Promotion code field altogether from the checkout. You could do something similar based on X and Y event, or pull the transaction total and compare that against a value and remove the promotion code field.
The above obviously depends on how comfortable with PHP you are, if you are not comfortable using PHP we recommend the folks at codeable who may be able to create something for you.
Eventually, in a future version of EE we’d like to include functions like this, for example, we have this on our roadmap:
Which sounds like it may cover your use case, but those features are not due out soon as we are working on other areas of the plugin.
Thank you, Tony! I will see what I can do with the above!