Support » Plugin: WooCommerce » [Plugin: WooCommerce – excelling eCommerce] WooCommerce – Free Checkout Solution Here

  • Finally, I figured out how to make WooCommerce only ask for first name, last name, email address, and order notes during checkout for orders of $0. If you want to do this too, add the following code to your functions.php.

    // REMOVE FIELDS FROM WOO CHECKOUT PAGE IF ORDER TOTAL IS ZERO
    add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
    function custom_override_checkout_fields( $fields ) {
    	global $woocommerce;
    	$my_carttotal = $woocommerce->cart->total;
    	if($my_carttotal == 0){
    		unset($fields['billing']['billing_address_1']);
    		unset($fields['billing']['billing_address_2']);
    		unset($fields['billing']['billing_city']);
    		unset($fields['billing']['billing_postcode']);
    		unset($fields['billing']['billing_country']);
    		unset($fields['billing']['billing_state']);
    		unset($fields['billing']['billing_phone']);
    		return $fields;
    	} else {
    		return $fields;
    	}
    }

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • it works but still makes appear the “undefined index” error with debug activated.

    so sad they made it so difficult to customize the checkout fileds

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WooCommerce – excelling eCommerce] WooCommerce – Free Checkout Solution Here’ is closed to new replies.