Skip to content

Commit 2fca4c5

Browse files
MAGETWO-39857: Event 'customer_save_after_data_object' dispatches a few times
1 parent 8bfa512 commit 2fca4c5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

app/code/Magento/Quote/Model/Observer/Backend/CustomerQuote.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ public function dispatch(Observer $observer)
5858
try {
5959
$quote = $this->quoteRepository->getForCustomer($customer->getId());
6060
if ($customer->getGroupId() !== $quote->getCustomerGroupId()) {
61-
/**
62-
* It is needed to process customer's quotes for all websites
63-
* if customer accounts are shared between all of them
64-
*/
65-
/** @var $websites \Magento\Store\Model\Website[] */
66-
$websites = $this->config->isWebsiteScope()
67-
? [$this->storeManager->getWebsite($customer->getWebsiteId())]
68-
: $this->storeManager->getWebsites();
61+
/**
62+
* It is needed to process customer's quotes for all websites
63+
* if customer accounts are shared between all of them
64+
*/
65+
/** @var $websites \Magento\Store\Model\Website[] */
66+
$websites = $this->config->isWebsiteScope()
67+
? [$this->storeManager->getWebsite($customer->getWebsiteId())]
68+
: $this->storeManager->getWebsites();
6969

70-
foreach ($websites as $website) {
70+
foreach ($websites as $website) {
7171
$quote->setWebsite($website);
7272
$quote->setCustomerGroupId($customer->getGroupId());
7373
$quote->collectTotals();

0 commit comments

Comments
 (0)