22 private $customerSession;
29 $this->customerSession = $customerSession;
40 if ($this->isDefaultBilling(
$address)) {
41 $this->customerSession->setDefaultTaxBillingAddress(
43 'country_id' =>
$address->getCountryId(),
45 'postcode' =>
$address->getPostcode(),
49 if ($this->isDefaultShipping(
$address)) {
50 $this->customerSession->setDefaultTaxShippingAddress(
52 'country_id' =>
$address->getCountryId(),
54 'postcode' =>
$address->getPostcode(),
68 $defaultShippingFound =
false;
69 $defaultBillingFound =
false;
72 $defaultBillingFound =
true;
73 $this->customerSession->setDefaultTaxBillingAddress(
75 'country_id' =>
$address->getCountryId(),
77 'postcode' =>
$address->getPostcode(),
82 $defaultShippingFound =
true;
83 $this->customerSession->setDefaultTaxShippingAddress(
85 'country_id' =>
$address->getCountryId(),
87 'postcode' =>
$address->getPostcode(),
91 if ($defaultShippingFound && $defaultBillingFound) {
116 private function isDefaultShipping(Address
$address)
120 ||
$address->getIsDefaultShipping();
setDefaultAddressAfterSave(Address $address)
setDefaultAddressAfterLogIn(array $addresses)
__construct(Session $customerSession)