Title: Discount codes bug?
Last modified: January 21, 2019

---

# Discount codes bug?

 *  Resolved [carloeucandido](https://wordpress.org/support/users/carloeucandido/)
 * (@carloeucandido)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/discount-codes-bug/)
 * When I try to apply a discount code, jQuery fails to show success text.
    Firefox
   console debugger gives a sintax error: “missing ) after argument list” related
   to this line: `else {$("#pmpro_message").html(responseHTML);}` Moreover, one 
   of my customers reported an error type 1: “Error applying discount code [1]” ,
   still don’t know if the customer didn’t apply the code correctly or it’s part
   of this bug
 * This bug (if it’s really a bug) it’s not related to the latest version, because
   now I’ve installed 2.04 but when I noticed it (this morning) I had one of the
   previous versions of PMpro (not 2.03 but I can’t remember which one)
    I’m sure
   that in the past the code was working on my website Thank you in advance
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdiscount-codes-bug%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/discount-codes-bug/#post-11112866)
 * Hi there,
 * Thank you for using Paid Memberships Pro, I have just tested this and I am unable
   to recreate this issue on my end.
 * Are you using any plugin that may affect JQuery such as minification or load 
   a different jQuery version?
 * Could you please create a new discount code and retest this for me and let me
   know if the issue persists.
 *  Thread Starter [carloeucandido](https://wordpress.org/support/users/carloeucandido/)
 * (@carloeucandido)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/discount-codes-bug/#post-11113252)
 * Hi Andrew and thank you for your kind reply
 * I’ve SOLVED!
 * – I already tried with different discount codes, old ones and a new one.
    – Yes,
   there’s a minification.. but the problem is not there
 * Solution: in italian we use apostrophes… a lot! So the translation of the success
   string contained an apostrophe and it wasn’t escaped when string is loaded into
   jquery script!
    I removed the contraction mark and now it works…. but now my 
   question becomes: is there any other case where this issue could occur? How many
   strings could be affected?
 * Probably some time ago I changed my .po file and I didn’t realize I triggered
   an error, neither my users reported it to me
 *  Plugin Author [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/discount-codes-bug/#post-11121694)
 * Thanks for the feedback, I have added this to our development schedule to try
   and avoid this issue when a discount code contains certain characters.
 * I don’t think there are any other ways for this error to occur, if you find other
   ways please do let me know.
 *  Thread Starter [carloeucandido](https://wordpress.org/support/users/carloeucandido/)
 * (@carloeucandido)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/discount-codes-bug/#post-11122579)
 * Ok Andrew but please note that it’s not about special characters inside the discount
   code BUT inside the strings associated to discount codes processing, and their
   translation in the .po / .mo files. So in my opinion any other string passed 
   to jQuery and not escaped for special char could be affected. I’m not a programmer
   so please forgive me if I’ve written something obvious or wrong.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Discount codes bug?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/paid-memberships-pro_f1dacb.svg)
 * [Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions](https://wordpress.org/plugins/paid-memberships-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paid-memberships-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paid-memberships-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/paid-memberships-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paid-memberships-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paid-memberships-pro/reviews/)

## Tags

 * [discount codes](https://wordpress.org/support/topic-tag/discount-codes/)

 * 4 replies
 * 2 participants
 * Last reply from: [carloeucandido](https://wordpress.org/support/users/carloeucandido/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/discount-codes-bug/#post-11122579)
 * Status: resolved