check out field postcode change to select
-
im using WooCommerce below code i find in online and past it in my flatsome child function.php. when i use it the value come show in my check out postcode field is 0,1,3. the result should be 001122, 112200,334400.. can anyone help me. i really need the solution
`add_filter( ‘woocommerce_default_address_fields’ , ‘custom_override_default_postcode_field’ );
function custom_override_default_postcode_field( $address_fields ) {
// Your postcodes array
$postcode_array = array(
‘opt1’ => “001122”,
‘opt2’ => “112200”,
‘opt3’ => “334400”
);
$address_fields[‘postcode’][‘type’] = ‘select’;
$address_fields[‘postcode’][‘options’] = $postcode_array;return $address_fields;
}The page I need help with: [log in to see the link]
- The topic ‘check out field postcode change to select’ is closed to new replies.