Support

Home Forums Event Espresso Premium Creating a validation rule for use of a promo code

Creating a validation rule for use of a promo code

Posted: April 8, 2023 at 5:14 am

Viewing 3 reply threads


drkings1

April 8, 2023 at 5:14 am

Hi there,

We currently have a promo code that offers 5% off if you buy tickets to 2 events.

So the person puts event-a ticket and event-b ticket in their basket and is then entitled to use the promo code to claim their discount. (Since they are appropriately going to buy tickets to 2 different events).

Occasionally someone tries to use the promo code even though they have only put one ticket into their basket. In other words they are not entitled to use that discount code.

Is there any way to create a rule so that this discount code will only be applied when there are tickets to 2 or more separate events in the basket?

I think I can see from an answer in 2018 that you did not have this functionality then. Does it exist now? If not how I can request that you create it please?

In the meantime, assuming that this functionality doesn’t currently exist, is there anything that an external developer could do to work around this?

Thank you

Daniel


Tony

  • Support Staff

April 20, 2023 at 1:44 pm

Hi Daniel,

My apologies for the delayed reply, to explain, we currently do not have this functionality within Event Espresso and I wanted to set some time aside to check if there was a way for someone to achieve this via custom code.

Within the promotions add-on, when a promotion is submitted it pulls in the ‘applicable items’ and then passes those through a filter, which means that someone could hook into that process using the FHEE__EED_Promotions__get_applicable_items__applicable_items hook. From there they can check what is in the current cart and determine if they should return no applicable items and add a notice or allow the processing.

The filter in use is:

apply_filters(
    'FHEE__EED_Promotions__get_applicable_items__applicable_items',
    $applicable_items,
    $promotion,
    $redeemable_scope_promos,
    $events,
    $cart
);

So in short, no we do not currently have this functionality, but yes it would be possible to add custom code to do this.

If not how I can request that you create it please?

We do have these types of ‘volume discounts’ on our roadmap HERE.

However, we have to prioritise our developments on the features we get the most requests for and believe in being transparent on our development time. We have many other features with much higher numbers of requests for this so it is unlikely to be something we introduce ourselves ‘soon’.


drkings1

April 21, 2023 at 2:21 am

Hi Tony,

Thanks for getting back to me. I did wonder if you’d forgotten (!) – Thank you for explaining the delay.

That’s a helpful response. Thank you.

I will see if I can find a developer who can do that.

Warm regards

Daniel


Tony

  • Support Staff

April 21, 2023 at 6:18 am

Thanks for getting back to me. I did wonder if you’d forgotten (!) – Thank you for explaining the delay.

No, not forgotten 🙂

We are currently in a busy period with pushing the update out for EE5 so setting time aside to work through the code and check if custom code will work takes a little longer than usual.

I will see if I can find a developer who can do that.

Whilst we don’t provide support for custom code if I can help point someone in the right direction I will.

That’s not to say I’ll write the custom code for them, so posting up ‘how do I do this’ with zero effort made in terms of a solution will not get a solution. But more than happy to point out an issue when stuck for example (if I’m able to).

Viewing 3 reply threads

The support post ‘Creating a validation rule for use of a promo code’ 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