0
votes

I am stuck with trying to configure my website's checkout fields in woo commerce.It comes prefilled with values and doesnt get removed even after purging the cache. https://shinujohn.com/checkout/ ...set as with the default shortcode enter image description here

The country has 2 field boxes now...one is clickable drop down. Server side caching is disabled.

The theme I'm using is Kallyas

I Have tried:-

  1. Field editor : It does not even show the field ..say company name.and adding a new field is not reflected here.even if i add it to the billing or checkout fields enter image description here
  2. Adding code to functions.php

/returning woo commerce field as blank/

add_filter('woocommerce_checkout_get_value','__return_empty_string', 1, 1);
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
add_filter( 'woocommerce_billing_fields' , 'custom_override_billing_fields' );

or

    function custom_override_billing_fields( $fields ) {
      unset($fields['billing_postcode']);
      unset($fields['billing_state']);
      unset($fields['billing_country']);
      unset($fields['billing_address_1']);
      return $fields;
    }

neither work 3. issue persists with multiple browsers and unlogged users in different machines.. 4. Within the theme's page editor... i can of course change front end ...but it doesnt reflect it after publishing.

1

1 Answers

0
votes

I don't recommend you to use any extra plugin to edit the Woocommerce checkout fields. Here is the simple solution that you can easily customize the Woocommerce checkout fields.

add_filter( 'woocommerce_checkout_fields' , 'custom_override_billing_fields', 5);

function custom_override_billing_fields( $fields ) {
     unset($fields['billing']['billing_postcode']);
     unset($fields['billing']['billing_state']);
     unset($fields['billing']['billing_country']);
     unset($fields['billing']['billing_address_1']);
     return $fields;
}

May this code helps you.