Support

Home Forums Event Espresso Premium Promotion codes not being accepted

Promotion codes not being accepted

Posted: April 19, 2024 at 8:21 am

Viewing 8 reply threads


mlevison

April 19, 2024 at 8:21 am

I have a newly created promotion code: UNEMPLOYED-2024

I attempt to apply it to an upcoming workshop and I get this error:
An unknown error occurred on the server while attempting to process your request Please refresh the page and try again or contact support.

I’m assuming this tells me I’ve misconfigured my promotion code.

It’s applied to all events that are currently posted. It’s started two days ago and is valid until the end of the year.

What have I mis-configured?


Rio

  • Support Staff

April 19, 2024 at 8:56 am

This reply has been marked as private.


mlevison

April 19, 2024 at 9:03 am

I have a screenshot of the whole page: https://www.dropbox.com/scl/fi/xv6b146gz52g5jbyzi1wy/PromoCodeMisconfigured.png?rlkey=nfp66t024whibv0pw2y9jwhda&dl=0 — I will do a screen recording if you can tell what to cover that isn’t in the picture.

Event Link (ooops meant to include that in the first try): https://agilepainrelief.com/courses/virtual-20240504csm


Tony

  • Support Staff

April 19, 2024 at 9:38 am

Hi there,

That doesn’t look like misconfiguration to me, it looks fine.

The unknown error isn’t a misconfiguration, it’s an unknown, so something the code doesn’t handle currently.

Do you have error logging enabled on the server?


mlevison

April 19, 2024 at 9:56 am

We have logging on the go. I have a divide zero error in line 643 of EE_Promotion_Event_Scope:

[Fri Apr 19 14:08:23.866272 2024] [php:error] [pid 5897] [client 184.145.13.88:0] PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in /nas/content/live/aprthemetest1/wp-content/plugins/eea-promotions/lib/scopes/EE_Promotion_Event_Scope.lib.php:643\nStack trace:\n#0 /nas/content/live/aprthemetest1/wp-content/plugins/eea-promotions/lib/scopes/EE_Promotion_Event_Scope.lib.php(574): EE_Promotion_Event_Scope->calculateAndApplyPromotionBeforeTaxes(Array, Object(EE_Line_Item), Object(EE_Promotion))\n#1 /nas/content/live/aprthemetest1/wp-content/plugins/eea-promotions/EED_Promotions.module.php(1149): EE_Promotion_Event_Scope->calculateAndApplyPromotion(Array, Object(EE_Line_Item), Object(EE_Promotion), true)\n#2 /nas/content/live/aprthemetest1/wp-content/plugins/eea-promotions/EED_Promotions.module.php(790): EED_Promotions->generate_promotion_line_items(Object(EE_Promotion), Array, true)\n#3 /nas/content/live/aprthemetest1/wp-content/plugins/eea-promotions/EED_Promotions.module.php(758): EED_Promotions->submitPromoCode()\n#4 /nas/content/live/aprthemetest1/wp-includes/class-wp-hook.php(324): EED_Promotions::submit_promo_code(”)\n#5 /nas/content/live/aprthemetest1/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(”, Array)\n#6 /nas/content/live/aprthemetest1/wp-includes/plugin.php(517): WP_Hook->do_action(Array)\n#7 /nas/content/live/aprthemetest1/wp-admin/admin-ajax.php(203): do_action(‘wp_ajax_nopriv_…’)\n#8 {main}\n thrown in /nas/content/live/aprthemetest1/wp-content/plugins/eea-promotions/lib/scopes/EE_Promotion_Event_Scope.lib.php on line 643, referer: https://agilepainrelief.com/registration-checkout?uts=1713535383

FWIW We’re still on 5.0.17p – because of the error documented at the beginning of the month: https://eventespresso.com/topic/event-showing-ticket-details-for-wrong-event/ — The members of my team who normally run the backend are on vacation so I really hope we don’t need an update. (I can do the update, I just have no idea what to test afterwards).


Tony

  • Support Staff

April 19, 2024 at 6:07 pm

Hmm, this is strange.

I’ve spent some time trying to reproduce this but so far I’ve been unable to (I’ve tried matching your installed versions on a test site to confirm it isn’t a version issue).

The code that is failing is:

$promo_amount = round($original_promo_amount / $ticket_count, 6, PHP_ROUND_HALF_DOWN);

So either $original_promo_amount is 0 (which is shouldn’t be, its the dollar amount of the discount code, yours is set).

Or $ticket_count is set, but to event get to that point, $ticket_count had to be at least 1 earlier on!

I think the only way I’m going to be able to troubleshoot this is to take a look at what is happening with the line items on the site, I’d need FTP access to do that so I can add some debug code within the promotions add-on and find out what values are being set.

If your ok with that then send temp login details over using this form:

https://eventespresso.com/send-login-details/

Any custom code within the checkout page at all?


mlevison

April 20, 2024 at 4:14 pm

I’ve only tested the custom code, mentioned above.

Credentials – I used the WordPress feature to resend you the password that was already on the support@eventespresso.com account.


mlevison

April 20, 2024 at 4:14 pm

I’ve only tested the custom code, mentioned above.

Credentials – I used the WordPress feature to resend you the password that was already on the support@eventespresso.com account.


Rio

  • Support Staff

April 22, 2024 at 12:51 am

Hello,

You might filled the form before, but We don’t store log-in. we will be needing you to send through form so you can fill the FTP credentials too.

thanks


Tony

  • Support Staff

April 23, 2024 at 9:12 am

Hi there,

So it looks like the issue is with the “Agile EE Promo Code Limiter” plugin you have active on the site.

I opened up a registration checkout session and got to the payment options, inputting your promotion code showed the error you posted. In another tab I then disabled the above plugin and resubmitted the promotion code, it worked as expected.

https://monosnap.com/file/2qxyN4UKQ3zGZ29aks36wY59RhcVA5

I’ve since reactivated that plugin as it’s custom I don’t know what else it does but the code in that plugin will need to be investigated to see what is happening here.

Viewing 8 reply threads

The support post ‘Promotion codes not being accepted’ 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