Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Select group by custom field (not only id)
 
asrenzo
Member
 
Avatar
Total Posts:  42
Joined:  2008-02-25
France
 

Hi,

I added a new field (aka mynewfield) in the group table. I customized the group management interface (using a local package of my own) to deal with this new field.

Now I need to retrieve one of this group during account creation relatively to a form field data (aka mynewfieldformvalue )

Is there a way to select a group from something else than his id ?

I know :

customerGroup->load($id)

but I wish I could use something like:

customerGroup->loadBy('mynewfield'$mynewfieldformvalue)

Regards,

Laurent

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Actually there’s optional 2nd argument to load() method to specify field to look by:

$customerGroup->load($mynewfieldformvalue'mynewfield');
 
Magento Community Magento Community
Magento Community
Magento Community
 
asrenzo
Member
 
Avatar
Total Posts:  42
Joined:  2008-02-25
France
 

Great, thank you moshe for this answer on a saturday

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top