• Resolved tigermediamao

    (@tigermediamao)


    Hello.

    I used this code snippet to hide the woocommerce coupon from cart:

    // Hiding coupon from cart.
    function disable_coupon_field_on_cart( $enabled ) {
    	if ( is_cart() ) {
    		$enabled = false;
    	}
    	return $enabled;
    }
    add_filter('woocommerce_coupons_enabled', 'disable_coupon_field_on_cart');

    Instead i would like to show it on the hook:
    woocommerce_cart_totals_before_order_total

    i tried this:

    // Display coupon in cart-totals.
    function enable_coupon_field_on_cart( $enabled ) {
      if ( is_cart_totals() ) {
        $enabled = true;
      }
      return $enabled;
    }
    
    add_filter( 'woocommerce_proceed_to_checkout', 'enable_coupon_field_on_cart' );

    But it does not work. any fix / smarter way of moving this coupon field to display right before “proceed to checkout” button instead of underneath the products in cart?

    • This topic was modified 3 years, 7 months ago by tigermediamao.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Hiding coupon field on cart and displaying above proceed_to_checkout instead’ is closed to new replies.