Support

Home Forums Event Espresso Premium Apply coupon to specific ticket

Apply coupon to specific ticket

Posted: March 2, 2020 at 11:31 am

Viewing 5 reply threads


botanicwise

March 2, 2020 at 11:31 am

Hi, we very much need to limit coupons to specific tickets without having to set up a completely different event. I am aware that this is currently a feature on the request board and is not yet on the roadmap.

Is there any possible workaround for this? I am willing to code it (for my customer) if given some guidance on the feasibility of it.


Josh

  • Support Staff

March 2, 2020 at 12:39 pm

Hi,

This can be coded by following the example in this snippet:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/addons/eea-promotions/bc_ee_ticket_scope_promotions.php

You can add the above to a functions plugin then modify to your customer’s specifications.


botanicwise

March 2, 2020 at 1:05 pm

Awesome, thanks, Josh!

The ticket id to include in the array, is the ticket id shown under the advanced settings of the ticket?

Also, would it be possible to add a custom field to the promotion record where a user could specify a simple comma-delimited list of tickets to be included? Do you see any issues with that? (I realize that is not how you would want to implement in a product just want a way that I don’t have to hard-code it for my customer.)


Tony

  • Support Staff

March 3, 2020 at 3:01 am

The ticket id to include in the array, is the ticket id shown under the advanced settings of the ticket?

Yes, click on the icon and in the bottom left you’ll have something like “Ticket ID: 12076”

That’s the Ticket ID.

Also, would it be possible to add a custom field to the promotion record where a user could specify a simple comma-delimited list of tickets to be included?

Possible, yes, but adding an input to the promotion create/edit page currently isn’t expected so there are no hooks for it, you would need to override the template used with your own.

You could store the values in Extra_Meta.

Do you see any issues with that?

None of the top of my head but general disclaimer here, I haven’t gone through planning/testing for this to work, it should be fine but something may come up that I/We haven’t thought of.

Another user used the ticket names to determine if promotions should apply to is here:

https://eventespresso.com/topic/promo-code-for-specific-ticket-types/

They are chacking for tickets with the name ‘Regular’ and apply promotions to that, would something like that work for you here?


botanicwise

March 9, 2020 at 12:10 pm

Great, got this working. Thanks so much for your help! Would love to see this functionality added to the promotions addon in the future!


Tony

  • Support Staff

March 10, 2020 at 6:19 am

You’re most welcome.

We do have plans to add a ticket ‘scope’ to the promotions add-on (meaning you can apply promotions to specific tickets) in the future. Just to note, we are currently working on other areas of the plugin so it will not be something we release ‘soon’.

Viewing 5 reply threads

The support post ‘Apply coupon to specific ticket’ 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