Skip to content

Commit f9757ab

Browse files
ihorvansachnaydav
authored andcommitted
Fixed issue magento2-login-as-customer/issues/159
1 parent 94a08ef commit f9757ab

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

app/code/Magento/LoginAsCustomerQuote/Plugin/LoginAsCustomerApi/ProcessShoppingCartPlugin.php

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(
6060
}
6161

6262
/**
63-
* Remove all items from guest shopping cart
63+
* Remove all items from guest shopping cart and mark customer cart as not-guest
6464
*
6565
* @param AuthenticateCustomerBySecretInterface $subject
6666
* @param string $secret
@@ -77,31 +77,9 @@ public function beforeExecute(
7777
$quote = $this->checkoutSession->getQuote();
7878
/* Remove items from guest cart */
7979
$quote->removeAllItems();
80+
$quote->setCustomerIsGuest(0);
8081
$this->quoteRepository->save($quote);
8182
}
8283
return null;
8384
}
84-
85-
/**
86-
* Mark customer cart as not-guest
87-
*
88-
* @param AuthenticateCustomerBySecretInterface $subject
89-
* @param void $result
90-
* @param string $secret
91-
* @return void
92-
* @throws LocalizedException
93-
*
94-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
95-
*/
96-
public function afterExecute(
97-
AuthenticateCustomerBySecretInterface $subject,
98-
$result,
99-
string $secret
100-
) {
101-
$this->checkoutSession->loadCustomerQuote();
102-
$quote = $this->checkoutSession->getQuote();
103-
104-
$quote->setCustomerIsGuest(0);
105-
$this->quoteRepository->save($quote);
106-
}
10785
}

0 commit comments

Comments
 (0)