Skip to content

Commit ecca751

Browse files
committed
MC-4242: Newsletter subscriptions per website
1 parent 3ccaec5 commit ecca751

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,11 @@ public function afterDelete(CustomerRepositoryInterface $subject, $result, Custo
220220
*/
221221
public function afterGetById(CustomerRepositoryInterface $subject, CustomerInterface $customer)
222222
{
223-
$isSubscribed = $this->getSubscriber($customer)->isSubscribed();
224-
$this->addIsSubscribedExtensionAttr($customer, $isSubscribed);
223+
$extensionAttributes = $customer->getExtensionAttributes();
224+
if ($extensionAttributes === null || $extensionAttributes->getIsSubscribed() === null) {
225+
$isSubscribed = $this->getSubscriber($customer)->isSubscribed();
226+
$this->addIsSubscribedExtensionAttr($customer, $isSubscribed);
227+
}
225228

226229
return $customer;
227230
}

0 commit comments

Comments
 (0)