Reputation: 8885
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.
Upvotes: 4
Views: 7502
Reputation: 23205
$targetGroup = Mage::getModel('customer/group');
$targetGroup->load($groupName, 'customer_group_code');
Ref. customer_group
table.
Upvotes: 11