Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Mike M. a11n

    (@mikedmoore)

    Automattic Happiness Engineer

    Hey Sunnylife. To remove the “Company Name” field, you can filter woocommerce_checkout_fields.

    add_filter( 'woocommerce_checkout_fields' , 'remove_company_fields');
    function remove_company_fields( $fields ){
    
    	unset($fields['billing']['billing_company']);
    	unset($fields['shipping']['shipping_company']);
    
    	return $fields;
    
    }

    To limit states to Bihar you can filter woocommerce_states.

    add_filter( 'woocommerce_states', 'custom_states');
    function custom_states( $states ){
    	$states['IN'] = array(
    		'BR' => 'Bihar'
    	);
    
    	return $states;
    }

    You would add those snippets to your functions.php file.

    To limit the city field to only Patna, you might try enabling Local Delivery as a shipping option and limit the city by Post Code.

    Hope that helps.

    Thread Starter sunnylife

    (@sunnylife)

    I added these codes but it is not working.

    I want a function to :
    when I enter the postal code requires that the city appears alone

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘checkout page’ is closed to new replies.