• Resolved joshpa87

    (@joshpa87)


    I noticed an issue with our discount codes today. Coupon codes now only work when entered in lowercase. Previously that weren’t case sensitive.

    Every coupon we have set up uses uppercase (eg DISCOUNT100), but entering the code doesn’t work unless it is lowercase. So in this example you have to enter ‘discount100’ or the code doesn’t work at all.

    Is any one else having the same issue?

    I use the Pro version of the plugin if that’s helpful.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support akshayathangaraj

    (@akshayathangaraj)

    Hi,

    Thanks for reaching out!

    We did a check on our end, but unfortunately, we couldn’t reproduce the issue. It seems to be occurring only on your end. To help us investigate further, could you please create a support ticket here: Flycart Support?

    This will allow our team to look into it more closely and get it resolved for you.

    Thanks again, and feel free to reach out if you have any other questions!

    Regards,

    Flycart Support Team.

    Thread Starter joshpa87

    (@joshpa87)

    For those relying on this plugin – while we wait for an update here is some code I am using to help mitigate the issue:

    If you’re using URL coupons, this first snippet will check the url for a coupon, convert it lowercase and add a banner asking the customer to enter the code manually.

    This code can be added sitewide, by using a code snippet plugin like WP CODE.

    <script>
    document.addEventListener('DOMContentLoaded', function () {
    const urlParams = new URLSearchParams(window.location.search);
    let couponParam = urlParams.get('wdr_coupon');

    if (couponParam) {
    couponParam = couponParam.toLowerCase(); // convert to lowercase

    const banner = document.createElement('div');
    banner.id = 'wdr-coupon-banner';
    banner.style.cssText = 'background:#f00;padding:15px;border-bottom:1px solid #ccc;text-align:center;font-size:16px;position:fixed;top:0;width:100%;z-index:99999999;color:#ffffff';
    banner.innerHTML =
    <br> <span>Enter your coupon code: <span style="background:#000000; color:#ffffff; padding: 5px 10px; border-radius:5px;margin-right:5px; margin-left:5px"><strong>${couponParam}</strong></span> in the cart or checkout to apply your discount!</span><br> <button id="dismiss-wdr-banner" style="margin-left:15px;padding:5px 10px; background:#ffffff; color: #000000">Dismiss</button><br>;

    document.body.prepend(banner);
    document.body.style.marginTop = '60px';

    document.getElementById('dismiss-wdr-banner').addEventListener('click', function () {
    banner.remove();
    document.body.style.marginTop = '0';

    });
    }
    });
    </script>

    For people entering codes manually, this second Snippet changes the coupon error message and asks the customer to enter their coupon in lowercase. It needs to be added to your functions.php file.

    function coupon_error_message_change($err, $err_code, $WC_Coupon) {
    switch ( $err_code ) {
    case $WC_Coupon::E_WC_COUPON_NOT_EXIST:
    $err = "Error, please try entering your coupon code using all lowercase letters. Eg: 'coupon'";
    }
    return $err;
    }

    add_filter( 'woocommerce_coupon_error','coupon_error_message_change',10,3 );

    Cheers.

    • This reply was modified 12 months ago by joshpa87. Reason: code fix
    Plugin Support haripradeepa

    (@haripradeepa)

    Hello,
    Thank you for your patience.

    We’re happy to inform you that the issue has been resolved. Please find the updated core pack below. Feel free to download it and kindly check if the coupon code is now being applied correctly.

    Here is the Pack URL: https://www.dropbox.com/scl/fi/ioxnm5tly08elug0ua5aj/woo-discount-rules.zip?rlkey=ywtixuyu90f6cu02pztym80ht&st=n3pv5ovx&dl=1

    Let us know if you need any further assistance.

    Best regards,
    Flycart Team.

    Plugin Support haripradeepa

    (@haripradeepa)

    Hello,
    Thank you for your response.

    We have tested our plugin and sent it over to you, as we’ve received a high volume of requests due to this issue. There are still a few minor checks remaining, but we expect to officially release the next version by the end of the day tomorrow.

    We hope this clears things up!

    Thank you,
    Flycart Team

    Thread Starter joshpa87

    (@joshpa87)

    Thank you, the new version seems to have resolved the issue. Appreciate you and your team acting so quickly.

    • This reply was modified 12 months ago by joshpa87.
    Plugin Support haripradeepa

    (@haripradeepa)

    Hello there,
    Thank you so much for confirming the resolution of the issue.

    We are delighted to hear that it has been resolved, and we are confident that it will be released very soon.
    Your cooperation and support are greatly appreciated. Have a wonderful day!

    Thanks
    Flycart Team

    Moderator Support Moderator

    (@moderator)

    Thank you, the new version seems to have resolved the issue. Appreciate you and your team acting so quickly.

    If you need support and are not the person who started this topic then per the forum guidelines please start your own topic.

    https://ww.wp.xz.cn/support/forum-user-guide/faq/#i-have-the-same-problem-can-i-just-reply-to-someone-elses-post-with-me-too

    The many “I have this topic too” replies have been removed.

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

The topic ‘Plugin became case sensitive?’ is closed to new replies.