0

Hey guys please take a look at this image first!

enter image description here

I want to add a new field for selecting the customer group in the registration field. So the customer will take the responsibility for selecting the right customer group.

The problem here, I don't know how to get the customer group list to the UI and how to send it back the database when the customer has done the registering.

Please help me, I'm not very familiar with this Magento 2.x thing.

0

you can get customer group on your phml file.

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();        
 $customerGroupsCollection = $objectManager->get('\Magento\Customer\Model\ResourceModel\Group\Collection');
$customerGroups = $customerGroupsCollection->toOptionArray();
var_dump($customerGroups);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy