Question

I need to know how we can achieve this when the user changes its group to another customer group that has a different price.

This is working when the user logout and gets login again but I want to change the price or get the product price as per group by making the user not to logout and login again.

For example, there is 2 customer group 1. wholesale and 2. general.

Product A is 10$ for General and 8$ for Wholesale.

The first User is assigned to General and then the user is free to changes its group from MyAccount.

After the user changes its group from general to wholesale then the price of Product A should get change from 10$ to 8$.

Thanks

Was it helpful?

Solution

I got this how we can change product price after group get change

$this->_customerSession->setCustomerGroupId($group_id);

Namespace used: \Magento\Customer\Model\Session

Might this help someone

Happy coding

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top