cancel
Showing results for 
Search instead for 
Did you mean: 

Override customer group functions

Override customer group functions

Hi all,

I have a Magento installation with 2 website. Customer can login into every website with a single login/credentials. Stores have both B2B and B2C solutions, so the customer have their own discounts when logged in. They could have different discounts based on the website: it means that a customer can have a SIlver discount (customer group) in a website and a Gold discount in the other. Discounts are based on catalog rule.

I override the getCustomerGroupId in \Magento\Customer\Model\Session model: customer group is read in a custom attribute, in order to get a different value based on the website. Apparently it works fine, but I noticed that it didn't actual work in the cart: when a product is view in the detail page, proper price is shown, but when is added in the cart, it has the price without any discount: it seems that price is calculated without evaluating the customerGroupId stored in the session.

What should I do to fix this behavior? Should I override something in the module-cart?



Thanks in advance for your help.



Garrincha