Support

Home Forums Event Espresso Premium Block promo code usage for tickets without a WP user capability

Block promo code usage for tickets without a WP user capability

Posted: April 3, 2017 at 1:06 pm

Viewing 1 reply thread


jubileequeen

April 3, 2017 at 1:06 pm

Hello.

I need to block the promotion code usage for tickets without a WP user capability (WP User capability is blank). Only ticket with the “read” capability should allow promo codes.


Tony

  • Support Staff

April 6, 2017 at 11:00 am

Hi there,

EE does not have this functionality built in so you’ll need some custom development to do this. One option is to just remove the filter that adds the promo field to the checkout if the tickets from the current cart registrations don’t have the ‘read’ cap.

The promotion add-on uses the FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__before_payment_options filter hook at priority 10, so you’ll want to hook in at priority 9 or lower to do the above.

We have an example of how you can pull all the registrations from the current session here:

https://gist.github.com/Pebblo/f4561461339c59411a849f93c91912a9

Viewing 1 reply thread

The support post ‘Block promo code usage for tickets without a WP user capability’ 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