Adding new field to billing/shipping address under orders page in admin
-
I’m Dutch and in The Netherlands we use a different address format than in the US. We’d have to spit the street name and the house number. In order to fix that I used “address line 1” for ‘Street name’ and added a new custom checkout field called “house number”. When a user orders something everything works fine at checkout. But in the WordPress/Woocommerce admin I’m having difficulties.
When I’m viewing an order everything looks fine. That’s because I have a new address format:
add_filter( ‘woocommerce_localisation_address_formats’, ‘new_address_formats’ );
function new_address_formats( $formats ) {
$formats[‘NL’] = “{name}\n{company}\n{address_1} {billing_house_number} {shipping_house_number}\n{postcode} {city}\n{country}”;
return $formats;
}But the problem comes when I click on the “edit address” icon. Address line 1 isn’t called ‘Street name’, the House Number field isn’t present at all and Address line 2 needs to be unset:
PS: please see the link I attached with screenshoot
The page I need help with: [log in to see the link]
- The topic ‘Adding new field to billing/shipping address under orders page in admin’ is closed to new replies.