clime
clime

Reputation: 8885

Magento: load customer group by name

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

Answers (1)

benmarks
benmarks

Reputation: 23205

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

Ref. customer_group table.

Upvotes: 11

Related Questions