Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento: load customer group by name

Tags:

magento

How to load customer group by name in magento? I have tried this:

$targetGroup = Mage::getModel('customer/group')->load($groupName, 'name');

but it throws a sql exception that column customer_group.name does not exist.

like image 709
clime Avatar asked Dec 21 '22 05:12

clime


1 Answers

$targetGroup = Mage::getModel('customer/group');
$targetGroup->load($groupName, 'customer_group_code');

Ref. customer_group table.

like image 120
benmarks Avatar answered Dec 29 '22 21:12

benmarks