Skip to content

Commit

Permalink
Merge pull request #11776 from vinuvarshith/CRM-21830-state-province-…
Browse files Browse the repository at this point in the history
…tokens-not-working-billing-address

CRM-21830: Add 'state_province_name' token and set appropriate value …
  • Loading branch information
eileenmcnaughton authored Mar 11, 2018
2 parents 7dd2478 + b6fe7f0 commit 5dde2c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CRM/Utils/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ public static function getFormattedBillingAddressFieldsFromParameters($params, $
"city" => "billing_city-{$billingLocationTypeID}",
"postal_code" => "billing_postal_code-{$billingLocationTypeID}",
"state_province" => "state_province-{$billingLocationTypeID}",
"state_province_name" => "state_province-{$billingLocationTypeID}",
"country" => "country-{$billingLocationTypeID}",
);

Expand All @@ -348,10 +349,13 @@ public static function getFormattedBillingAddressFieldsFromParameters($params, $
$value = $params[$alternateName];
}
}
if (is_numeric($value) && ($name == 'state_province' || $name == 'country')) {
if (is_numeric($value) && ($name == 'state_province' || $name == 'state_province_name' || $name == 'country')) {
if ($name == 'state_province') {
$addressFields[$name] = CRM_Core_PseudoConstant::stateProvinceAbbreviation($value);
}
if ($name == 'state_province_name') {
$addressFields[$name] = CRM_Core_PseudoConstant::stateProvince($value);
}
if ($name == 'country') {
$addressFields[$name] = CRM_Core_PseudoConstant::countryIsoCode($value);
}
Expand Down

0 comments on commit 5dde2c0

Please sign in to comment.