Support

Home Forums Event Espresso Premium Promo code restrictions

Promo code restrictions

Posted: August 26, 2013 at 5:16 pm


thinkbiglearnsmart

August 26, 2013 at 5:16 pm

Is there a way to restrict promo codes to certain price points since we offer multiple pricing options for events?


Sidney Harrell

August 26, 2013 at 5:52 pm

You can restrict the use of coupon codes to over a certain price point per ticket by editing line 33 of includes/admin-files/coupon-management/use_coupon_code.php to read:

if ( ! $espresso_premium || $event_cost < 40.00) {

of course, substitute in your own cut-off point for the 40.00 I put in. You can preserve the customization by copying that whole function into the custom files add-on before you make the change. You could go further and put the cutoff limit into the event meta and pull it in your custom file based on the event id, so you could have different cut-off points for different events.


thinkbiglearnsmart

August 29, 2013 at 4:31 pm

Thanks! Can we do this by coupon – so certain coupons can only be used if the price is above $x?


Sidney Harrell

September 2, 2013 at 2:05 pm

You could try (instead of the above code) something like changing line 52 to:

$cutoffs = array('abc' => 39.99);
$cutoff = empty($cutoffs[$coupon_code]) ? 0 : $cutoffs[$coupon_code];
if ($use_coupon_code == 'Y' && $event_cost > $cutoff) {

Note that it is a greater than, not a greater than or equal to, because you don’t want a coupon to apply to an event with a cost of 0, so if you want the coupon to apply at $40, then make the cutoff for it to be $39.99. And if a coupon is not in the array, it’s cutoff defaults to 0.

The support post ‘Promo code restrictions’ 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