Initialize to store address format (#3477)

If the user has not entered an address yet, then the address fields will be displayed in a default order, because the $country will be empty. To fix this and initialize address formats to the stores locale, the $country variable is set to the base_country if it has no value
This commit is contained in:
Henrik Gregersen 2013-07-15 01:25:12 +02:00
parent f23f536f12
commit a0105bb043
1 changed files with 4 additions and 0 deletions

View File

@ -1039,6 +1039,10 @@ class WC_Countries {
* @return void * @return void
*/ */
public function get_address_fields( $country, $type = 'billing_' ) { public function get_address_fields( $country, $type = 'billing_' ) {
if (!$country)
$country = $this->get_base_country();
$fields = $this->get_default_address_fields(); $fields = $this->get_default_address_fields();
$locale = $this->get_country_locale(); $locale = $this->get_country_locale();