Support » Plugin: WooCommerce » Disable "apply coupon" in cart but keep in checkout???

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Mike Jolley

    (@mikejolley)

    You can hide it with CSS 🙂

    Thread Starter thebioguy

    (@thebioguy)

    No.

    CSS wont work. I tried every which way imaginable. Unless I missed something, please provide the CSS you are referring to.

    Here’s the solution… add this to your functions.php

    // hide coupon field on cart page
    function hide_coupon_field_on_cart( $enabled ) {
    if ( is_cart() ) {
    $enabled = false;
    }
    return $enabled;
    }
    add_filter( ‘woocommerce_coupons_enabled’, ‘hide_coupon_field_on_cart’ );

    Plugin Author Mike Jolley

    (@mikejolley)

    Send a link to the page and i’ll see what CSS is needed.

    Hey, did you achieve something you could share to the community?!

    Would be interesting..

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Just need to hide/remove this section: https://github.com/woothemes/woocommerce/blob/master/templates/cart/cart.php#L136-L141. It is definitely targetable with css.

    Thread Starter thebioguy

    (@thebioguy)

    CSS removed coupon from checkout as well.

    To remove it ONLY from your cart, add this to your functions.php :

    / hide coupon field on cart page
    function hide_coupon_field_on_cart( $enabled ) {
    if ( is_cart() ) {
    $enabled = false;
    }
    return $enabled;
    }
    add_filter( ‘woocommerce_coupons_enabled’, ‘hide_coupon_field_on_cart’ );

    thx!

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Could also just be more specific with your CSS and include the .woocommerce-cart body class. Then the css only applies on the cart page.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Disable "apply coupon" in cart but keep in checkout???’ is closed to new replies.