Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1051528
    mat_kinotek
    Participant

    Hi,
    I want to hide the ‘applu coupon’ button in the cart page so my customers only have the option to add coupons during check out. (here: http://cherrylaser.com/cart/ – upload a product first)
    I tried the code below but it’s not working, what CSS i have to use to hide ONLY the ‘apply coupon” button?
    Thanks

    .woocommerce .cart .actions .coupon input [type=”submit”] {
    display: none;
    }

    .woocommerce .cart .actions .coupon label, .woocommerce .cart .actions .apply_coupon input.button {
    display: none;
    }

    and also, how can I align the shipping options in tha page

    #1051918
    Prasant Rai
    Moderator

    Hello There,

    Thanks for writing in!

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.

    Then add the following code in your child theme function.php file.

    // 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' );
     
    // hide coupon field on checkout page
    function hide_coupon_field_on_checkout( $enabled ) {
     
    	if ( is_checkout() ) {
    		$enabled = true;
    	}
     
    	return $enabled;
    }
    add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_checkout' );

    Let us know how it goes.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1051528 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>