Skip to content

Commit c40251a

Browse files
committed
MC-5681: Onepage Checkout improvements.
1 parent 8d78cc1 commit c40251a

File tree

1 file changed

+0
-55
lines changed

1 file changed

+0
-55
lines changed

app/code/Magento/Customer/Model/Address/CustomerAddressDataFormatter.php

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -46,38 +46,6 @@ public function __construct(
4646
$this->customAttributesProcessor = $customAttributesProcessor;
4747
}
4848

49-
/**
50-
* Prepare list of addressed that was selected by customer on checkout page.
51-
*
52-
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
53-
* @param \Magento\Quote\Model\Quote $quote
54-
* @param array $prepareAddressList
55-
* @return array
56-
*/
57-
public function prepareSelectedAddresses(
58-
\Magento\Customer\Api\Data\CustomerInterface $customer,
59-
\Magento\Quote\Model\Quote $quote,
60-
array $prepareAddressList
61-
): array {
62-
/** @var AddressInterface $billingAddress */
63-
$billingAddress = $quote->getBillingAddress();
64-
$billingAddressId = $billingAddress->getOrigData('customer_address_id');
65-
$prepareAddressList = $this->prepareSelectedAddress($customer, $prepareAddressList, $billingAddressId);
66-
67-
$shippingAddressId = null;
68-
$shippingAssignments = $quote->getExtensionAttributes()->getShippingAssignments();
69-
if (isset($shippingAssignments[0])) {
70-
$shipping = current($shippingAssignments)->getData('shipping');
71-
/** @var AddressInterface $shippingAddress */
72-
$shippingAddress = $shipping->getAddress();
73-
$shippingAddressId = $shippingAddress->getOrigData('customer_address_id');
74-
}
75-
76-
$prepareAddressList = $this->prepareSelectedAddress($customer, $prepareAddressList, $shippingAddressId);
77-
78-
return $prepareAddressList;
79-
}
80-
8149
/**
8250
* Prepare customer address data.
8351
*
@@ -125,29 +93,6 @@ public function prepareAddress(AddressInterface $customerAddress)
12593
return $resultAddress;
12694
}
12795

128-
/**
129-
* Prepared address by for given customer with given address id.
130-
*
131-
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
132-
* @param array $addressList
133-
* @param int|null $addressId
134-
* @return array
135-
*/
136-
private function prepareSelectedAddress(
137-
\Magento\Customer\Api\Data\CustomerInterface $customer,
138-
array $addressList,
139-
$addressId = null
140-
): array {
141-
if (null !== $addressId && !isset($addressList[$addressId])) {
142-
$selectedAddress = $this->prepareAddress($customer->getAddresses()[$addressId]);
143-
if (isset($selectedAddress['id'])) {
144-
$addressList[$selectedAddress['id']] = $selectedAddress;
145-
}
146-
}
147-
148-
return $addressList;
149-
}
150-
15196
/**
15297
* Set additional customer address data
15398
*

0 commit comments

Comments
 (0)