Tagged: 

Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #1303894

    With help from you guys, I moved the coupon apply code down to the top of the Order section using this code:

    ccs style:
    #order_review > p.form-row.form-row-first, #order_review > p.form-row.form-row-last, .woocommerce-form-coupon-toggle + p {
    display: none; }

    functions.php:
    remove_action( ‘woocommerce_before_checkout_form’, ‘woocommerce_checkout_coupon_form’, 10 );
    add_action( ‘woocommerce_checkout_order_review’, ‘woocommerce_checkout_coupon_form’, 5 );

    function ava_custom_script_mod() {
    if ( wp_script_is( ‘avia-default’, ‘registered’ ) ) {
    wp_add_inline_script( ‘avia-default’, ‘
    (function($) {
    $(“.showcoupon”).on(“click”, function() {
    $(“#order_review > p.form-row.form-row-first, #order_review > p.form-row.form-row-last, .woocommerce-form-coupon-toggle + p”).toggle();
    });
    })(jQuery);
    ‘);
    }
    }
    add_action( ‘wp_enqueue_scripts’, ‘ava_custom_script_mod’, 9999);

    However, now when I input a coupon code it drops down to the credit card section and gives me an error:
    Error image

    Also, Entering the coupon code on the cart page does work.
    Can you please help me resolve this issue. Thanks in advance.

    • This topic was modified 3 years, 6 months ago by advteksol.
    #1304080

    You can use coupon code:

    #1304516

    Hi,

    Thank you for the inquiry.

    We are able to properly checkout using Stripe’s default credit card number, which is use for testing. Please check the screenshot below.

    Screenshot: https://imgur.com/3iKkaIB

    Best regards,
    Ismael

    #1304662

    The credit card processing works fine, it’s the coupon code that doesn’t allow the credit card option to work (or applies the discount)..

    #1305177

    Hi,

    Thank you for the clarification.

    We tried to check the issue again, applied the coupon code but we cannot use Stripe’s test card anymore because it is already in live mode. Do you have a staging site where we can still use the test cards?

    Best regards,
    Ismael

    #1305902

    Ok, had to set up a staging site so I could make the live site work for now. Please check it out the issue at the address below.

    Thanks.

    #1306123

    Hi,

    Does the coupon or discount work correctly when you remove the previous script? Have you tried asking the plugin authors for additional help?

    The coupon field should be hidden by default but for some reason it is showing immediately in your installation, so we suggested the previous script. The initial issue might be due to a particular plugin or a custom script.

    Best regards,
    Ismael

    #1306199

    The only plug-in associated with this I’m using is Woo Commerce. Removing the script does make it work, but the coupon code reverts to the top, not the Order section. You guys helped me with moving it and making it a clickable to expand, but it’s just not allowing the credit card entry now.

    #1306590

    Hi,

    Would you mind removing the previous script that we recommended previously? We would like to test it again without the script. Maybe we could come up with a solution without altering the order of the elements in the checkout container. And please post the login details in the private field.

    Best regards,
    Ismael

    #1306748

    OK, I’ve commented out the added code in the style.css sheet and functions.php file.

    Thanks.

    #1307080

    Hi,

    Looks like the coupon toggle is now working correctly even without the previous script that we recommended previously. Please try to remove the cache and visit the checkout page.

    Thank you for your patience.

    Best regards,
    Ismael

    #1307181

    I had removed all the scripts, including the one to move it down. If you put back the one to move it down, the coupon toggle is open and when you enter a coupon it immediately tries to run the payment and does not apply any discounts.

    #1307404

    Hi,

    Thank you for the info.

    Why do you need to move it down again? The issue occurs because when you move the coupon container down or relocate it, the default script that is responsible for the coupon field toggle cannot find the appropriate element anymore. We recommend keeping it in its default place.

    Best regards,
    Ismael

    #1307405

    Hey!

    UPDATE: If you really need to move the coupon, try the solution provided here instead.

    // https://www.cloudways.com/blog/move-woocommerce-coupon-field/

    Cheers!
    Ismael

    #1307827

    Thanks, that works except there’s a close button that isn’t styled. Can you tell me how to style it or even remove it?

    #1308435

    Hi,

    We cannot find the button when we checked the site, and the coupon container is still in its default place. Did you add the code from the article?

    Best regards,
    Ismael

    #1308539

    Definitely added the code and moved it down (as seen in the picture). Maybe you need to clear the browser cache. Make sure you are using the developmental website below.

    #1308724

    Hi,

    Thank you for the info.

    Try to use this css code to remove the button and the space above the coupon field.

    #coupon-anchor .ui-dialog-titlebar-close, #coupon-anchor #ui-id-2 {
        display: none;
    }
    

    Best regards,
    Ismael

    #1308995

    Close, but that also removes the Apply Coupon button after the code section…

    #1309214

    Hi,

    Sorry about that. We adjusted the code a bit. Please try it again.

    Best regards,
    Ismael

    #1309284

    Thank you – that seems to work as needed.

    #1309453

    Hi,

    If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 22 posts - 1 through 22 (of 22 total)
  • The topic ‘Fix Coupon Code Not Accepted’ is closed to new replies.