Unverified Commit 5dde2c09 authored by eileen's avatar eileen 🎱 Committed by GitHub

Merge pull request #11776 from...

Merge pull request #11776 from vinuvarshith/CRM-21830-state-province-tokens-not-working-billing-address

CRM-21830: Add 'state_province_name' token and set appropriate value …
parents 7dd2478a b6fe7f06
......@@ -331,6 +331,7 @@ class CRM_Utils_Address {
"city" => "billing_city-{$billingLocationTypeID}",
"postal_code" => "billing_postal_code-{$billingLocationTypeID}",
"state_province" => "state_province-{$billingLocationTypeID}",
"state_province_name" => "state_province-{$billingLocationTypeID}",
"country" => "country-{$billingLocationTypeID}",
);
......@@ -348,10 +349,13 @@ class CRM_Utils_Address {
$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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment