Prefilled Checkout Fields – Postcode not working
-
Hello,
I have managed to prefill some checkoutfields like City or adress_1 – but the postcode is not prefilled with the same syntax:
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { $fields['billing']['billing_address_1']['default'] = 'Street'; $fields['billing']['billing_city']['default'] = 'City'; $fields['billing']['billing_postcode']['default'] = '12345'; return $fields;
Also tried to apply this with the woocommerce_default_address_fields filter in addition:
add_filter( 'woocommerce_default_address_fields' , 'custom_override_default_address_fields' ); function custom_override_default_address_fields( $address_fields ) { $address_fields['address_1']['default'] = 'Street'; $address_fields['city']['default'] = 'City'; $address_fields['postcode']['default'] = '12345'; return $address_fields; }
But only Postcode is not prefilled.
Regards Franz
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Prefilled Checkout Fields – Postcode not working’ is closed to new replies.