MMPL1
MMPL1

Reputation: 543

How to edit fields in “ship to different address” form in Woocommerce?

I want to unset one field from checkout. I made simple function

add_filter( 'woocommerce_checkout_fields' , 'remove_checkout_fields' );
function remove_checkout_fields( $fields ){
    unset($fields['billing']['billing_country']);
    return $fields;
}

and it's working for standard form. When I click "ship to different address" the new form has this field. So my question is how to remove field for both forms?

Upvotes: 2

Views: 291

Answers (1)

Navneet Bhalodiya
Navneet Bhalodiya

Reputation: 434

you supposed to add this line also in you function

            unset($fields['shipping']['shipping_country']);

Upvotes: 4

Related Questions