I have a separate field for the house number, does your plugin support that ?

Yes, our plugin supports the separate field for the house number. Your have to paste those codes into your functions.php theme file and just customize it with the name of your fields.

Note : It assumes that your theme (or a plugin) is adding specific fields for the addresses ; at least one for the street name and one for the house number

First, you have to declare the countries where you want to separate the house number from the route name. In this example, we assume that we will separate the fields for bresilian and netherlands addresses.

add_filter('woogoogad_countries_with_additional_fields', 'my_countries_with_specific_street_number_handeling');

function my_countries_with_specific_street_number_handeling()
{
	//use country codes for the countries.
	return array('NL', 'BR');
}

Then, you have to specify the names of the fields. In the example, you have to change the names of the fields if they are different :

  • billing_street_name
  • billing_house_number
  • billing_house_number_suffix (not mandatory, just to group it with the other fields if you have this field, used for NL addresses)
  • billing_bairro (not mandatory, can be used for brazilian addresses)
  • shipping_street_name
  • shipping_house_number
  • shipping_house_number_suffix (not mandatory)
  • shipping_bairro (not mandatory)
add_filter('woogoogad_additional_fields', 'my_additional_fields_with_street_number');
function my_additional_fields_with_street_number()
{
	return array('billing' => array(
		'street_name' => 'billing_street_name', //edit the name or billing_address_1 to use the native field
		'house_number' => 'billing_house_number', //edit the name
		'house_number_suffix' => 'billing_house_number_suffix', //optional, for NL addresses. Edit the name if needed
		'bairro' => 'billing_bairro' //optional, the neighborhood field for BR addresses
	),
	'shipping' => array(
		'street_name' => 'shipping_street_name', //edit the name or shipping_address_1 to use the native field
		'house_number' => 'shipping_house_number', //edit the name
		'house_number_suffix' => 'shipping_house_number_suffix', //optional, for NL addresses. Edit the name if needed
		'bairro' => 'shipping_bairro' //optional, the neighborhood field for BR addresses
	));
}