I want to get current customer group id in phtml file. When I am not logged in still it is return general type customer group. How can get proper output?
Magento 2 – How to Get Current Customer Group ID
customer-groupfrontendmagento2
customer-groupfrontendmagento2
I want to get current customer group id in phtml file. When I am not logged in still it is return general type customer group. How can get proper output?
Best Answer
Magento\Customer\Model\Session $customerSession
using this class you will get the current customer group idNOTE: You only get customer id if the customer logged in