We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit c445aa14 authored by scott's avatar scott

Assign default values to billing address fields

parent 2dce8d69
...@@ -62,15 +62,33 @@ class AddressDataBuilder implements BuilderInterface ...@@ -62,15 +62,33 @@ class AddressDataBuilder implements BuilderInterface
$billingAddress = $order->getBillingAddress(); $billingAddress = $order->getBillingAddress();
if ($billingAddress) { if ($billingAddress) {
// filter housenumber from streetLine1 $requestBilling = ["street" => "N/A",
$requestBilling = ["street" => $billingAddress->getStreetLine1(), "postalCode" => '',
"postalCode" => $billingAddress->getPostcode(), "city" => "N/A",
"city" => $billingAddress->getCity(),
"houseNumberOrName" => '', "houseNumberOrName" => '',
"stateOrProvince" => $billingAddress->getRegionCode(), "stateOrProvince" => '',
"country" => $billingAddress->getCountryId() "country" => "ZZ"
]; ];
if ($billingAddress->getStreetLine1()) {
$requestBilling["street"] = $billingAddress->getStreetLine1();
}
if ($billingAddress->getPostcode()) {
$requestBilling["postalCode"] = $billingAddress->getPostcode();
}
if ($billingAddress->getCity()) {
$requestBilling["city"] = $billingAddress->getCity();
}
if ($billingAddress->getRegionCode()) {
$requestBilling["stateOrProvince"] = $billingAddress->getRegionCode();
}
if ($billingAddress->getCountryId()) {
$requestBilling["country"] = $billingAddress->getCountryId();
}
$result['billingAddress'] = $requestBilling; $result['billingAddress'] = $requestBilling;
} }
......
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