Skip to content

Commit 4602c5a

Browse files
committed
MAGETWO-52117: Customer group is not changed for logged in customer
1 parent 3f4dbdc commit 4602c5a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

app/code/Magento/Customer/Controller/Account/UpdateSession.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,17 @@ public function __construct(
7070
public function execute()
7171
{
7272
$customerData = $this->jsonHelper->jsonDecode($this->getRequest()->getContent());
73-
if (isset($customerData['customer_id']) && $this->notificationStorage->isExists(
73+
if (isset($customerData['customer_id'])
74+
&& $this->notificationStorage->isExists(
7475
NotificationStorage::UPDATE_CUSTOMER_SESSION,
75-
$customerData['customer_id'])
76+
$customerData['customer_id']
77+
)
7678
) {
7779
$customer = $this->customerRepository->getById($customerData['customer_id']);
7880
$this->session->setCustomerData($customer);
7981
$this->session->setCustomerGroupId($customer->getGroupId());
8082
$this->session->regenerateId();
81-
$this->notificationStorage->remove(NotificationStorage::UPDATE_CUSTOMER_SESSION, $customerData['customer_id']);
83+
$this->notificationStorage->remove(NotificationStorage::UPDATE_CUSTOMER_SESSION, $customer->getId());
8284
}
8385
}
8486
}

app/code/Magento/Customer/Model/Plugin/CustomerNotification.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ class CustomerNotification
4545
private $state;
4646

4747
/**
48+
* CustomerNotification constructor.
49+
*
4850
* @param Session $session
4951
* @param NotificationStorage $notificationStorage
5052
* @param CookieManagerInterface $cookieManager
5153
* @param CookieMetadataFactory $cookieMetadataFactory
54+
* @param State $state
5255
*/
5356
public function __construct(
5457
Session $session,

0 commit comments

Comments
 (0)