Support

Home Forums Event Espresso Premium Promotional Codes – conditional statement?

Promotional Codes – conditional statement?

Posted: December 27, 2013 at 12:11 pm

Viewing 5 reply threads


Angela Haddon

December 27, 2013 at 12:11 pm

Hi, I’d like to set up a promotional code that is available for people who wish to purchase Part 1 and Part 2 of an event type simultaneously. I was hoping that it would be possible to write a conditional statement that would allow the coupon code to be applied only when these two items are in the shopping cart. Is this possible? I am comfortable with PHP coding; just need a little guidance as to the correct file etc.
Thanks very much for your assistance!


Dean

December 30, 2013 at 6:02 am

Hi Angela,

Wouldn’t the Volume Discounts add on be easier? Set up a specific category for those two events and have the threshold set at two and set the discount.

Volume Discounts – https://eventespresso.com/wiki/volume-discounts/


Angela Haddon

December 31, 2013 at 3:14 pm

Hi Dean, I was hoping to use Volume Discounts for a separate purpose (ie. the one you suggested), which I could then apply to all events. Unfortunately it’s not possible to set up multiple ‘types’ of Volume Discount, which forces me to try alternatives for the specific’package deal’ I mentioned. If it’s too difficult, I can always set up a ‘package deal’ as a separate event, but if there is a way to couple Part 1 and 2 through coding, that would be preferable…


Sidney Harrell

December 31, 2013 at 4:50 pm

There is a filter available, filter_hook_espresso_coupon_results, which takes 3 parameters. You could write a function that checks the events in the session and the code being used and does not allow the code to be applied if both events are not in the session. See includes/functions/cart.php line 336.


Angela Haddon

January 1, 2014 at 1:38 pm

Thanks Sidney – I’ll look into that.


Dean

January 1, 2014 at 11:27 pm

Hi Angela,

Please let us know how you get on with it.

Viewing 5 reply threads

The support post ‘Promotional Codes – conditional statement?’ 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.

Event Espresso