Home › Forums › Basel support forum › Remove Country from Checkout
Remove Country from Checkout
- This topic has 3 replies, 2 voices, and was last updated 8 years, 4 months ago by
Artem Temos.
-
AuthorPosts
-
July 27, 2017 at 6:34 pm #16888
svaldesmParticipantHello,
I’ve managed to remove some fields from the checkout via two functions:
/*Make fields from Checkout optional*/ add_filter( 'woocommerce_default_address_fields' , 'custom_override_default_address_fields' ); function custom_override_default_address_fields( $address_fields ) { $address_fields['company']['required'] = false; $address_fields['country']['required'] = false; $address_fields['address_2']['required'] = false; $address_fields['city']['required'] = false; $address_fields['postcode']['required'] = false; return $address_fields; } /* Remove fields from Checkout */ add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { unset($fields['billing']['billing_company']); //unset($fields['billing']['billing_country']); unset($fields['billing']['billing_address_2']); unset($fields['billing']['billing_city']); unset($fields['billing']['billing_postcode']); return $fields; }Nevertheless, when I try to buy something, I get an error. If remove the “unset” for country, it works.
How can I fix this? I only ship in one contry (which is default in WooCommerce config and appears as default).
Thanks
July 27, 2017 at 6:50 pm #16890
Artem TemosKeymasterHello,
This field comes with WooCommerce plugin, and not with our theme. Sorry, but additional customization of third party plugins is out of our theme support scope.
Regards
July 27, 2017 at 6:56 pm #16891
svaldesmParticipantThanks. At least, do you have any clue where this goes? Maybe some docs you remember. So far nothing.
Thanks!
July 27, 2017 at 7:08 pm #16892
Artem TemosKeymasterWe suggest you to try this plugin to manage your checkout fields https://wordpress.org/plugins/woocommerce-checkout-manager/
-
AuthorPosts
Tagged: checkout, remove country
- You must be logged in to create new topics. Login / Register
