Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    In theme functions.php add:

    remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
    Thread Starter LeonGeb

    (@leongeb)

    Hello Mike,

    Thank you for your answer. Unfortunately the code is not working. I added it to my theme’s functions.php refreshed my website and entered a coupon. It still shows in the summary.

    Best regards,
    Leon

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Ah this was the remove the form on checkout page 🙂

    You can hide it from the summary with some CSS code.

    tr.cart-discount td { display: none }
    Thread Starter LeonGeb

    (@leongeb)

    Hi Mike,

    is it css/woocommerce.css?
    I added this line into the style sheet but it kinda broke my css now. it seems all tables have disappeared even after removing the line again.

    i’m currently pulling a backup to try again.

    Thread Starter LeonGeb

    (@leongeb)

    Hello Mike,

    Semicolon was missing. However this is still not quite what I wanted. After adding the code it still shows the coupon code in the summary but instead it hides the discount (actually I’m rooting for the exact opposite)

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Use a custom CSS file or your theme’s. Otherwise you’ll lose the changes.

    tr.cart-discount td, tr.cart-discount th { display: none }

    That will hide both. There are a plethora of CSS tutorials on the web if you want to style any other elements.

    Thanks

    Thread Starter LeonGeb

    (@leongeb)

    Hi Mike,

    Thx a million. That worked.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Np 🙂

    hi

    Could u guys tell me how to display coupons on cart or checkout pages…

    help is appreciated

    thanks in advance

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

The topic ‘hide coupon code from checkout page’ is closed to new replies.