Is this actual solution: Variable Product, Virtual selected BUT shipping still
-
Is this actual solution in topic “Variable Product, Virtual selected BUT shipping still”? I try to use this code:
add_filter( 'woocommerce_checkout_fields' , 'bbloomer_simplify_checkout_virtual' ); function bbloomer_simplify_checkout_virtual( $fields ) { $only_virtual = true; foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { // Check if there are non-virtual products if ( ! $cart_item['data']->is_virtual() ) $only_virtual = false; } if( $only_virtual ) { unset($fields['billing']['billing_company']); 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']); add_filter( 'woocommerce_enable_order_notes_field', '__return_false' ); } return $fields; }
Nothing’s changes. Virtual Simple Product – and Page “Checkout” contain “Billing address”. Please help)
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Is this actual solution: Variable Product, Virtual selected BUT shipping still’ is closed to new replies.