Support

Home Forums Event Espresso Premium Question on successful coupon code message

Question on successful coupon code message

Posted: November 18, 2013 at 3:27 pm


infosolwebadmin

November 18, 2013 at 3:27 pm

I used the code that Sidney has linked to ( https://gist.github.com/sethshoultes/5650757 ) to update the text that shows when someone successfully enters a coupon code in their cart. By default it is: *coupon code and price* ‘has being successfully applied to the following events:’

My last question is: how do I get rid of the colon at the end? Because I am using an add to cart button in a modified espresso_table.php, the event it was applied to doesn’t get shown. So, I just want it to say the coupon code ‘has been successfully applied’, with no colon at the end. That way people don’t get thrown off, because they’ll expect to see the event name after the colon which mine won’t display.

I tried using sidney’s code to find and replace the string ‘has being successfully applied to the following events:’ and it didn’t work until I ditched the colon, so it must be inserted somewhere else in the code?

Thanks again!


Tony

  • Support Staff

November 19, 2013 at 12:57 am

Hi Yolande,

The colon is added in event-espresso/includes/admin-files/coupon-management/use_coupon_code.php line 141.

$msg .= __('has been successfully applied to the following events', 'event_espresso') . ':<br/>';

Change it to:

$msg .= __('has been successfully applied to the following events', 'event_espresso') . '<br/>';

As the function that string is created within is pluggable the ‘update safe’ method is to use the Custom Files Add-on, copy the whole function (lines 28-177) and paste it into the custom_functions.php file, then modify it there.

However, I can tell you that Event Espresso 3.1.36 has had some modifications to that file/function. So you will need to repeat the above for the new version of EE, replacing the function with the new one then modifying your string again.

Edit* The code editor is removing the br tag at the end of that string, you will likely want to keep that in.

  • This reply was modified 10 years, 5 months ago by  Tony. Reason: br tag
  • This reply was modified 10 years, 5 months ago by  Tony.


infosolwebadmin

November 19, 2013 at 12:10 pm

Thank you Tony! I took the colon out on that file, I will get get the code moved over into the custom functions file after the update is released.


Tony

  • Support Staff

November 19, 2013 at 12:58 pm

No Problem 🙂

The support post ‘Question on successful coupon code message’ 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