$customer_group
=
new
Mage_Customer_Model_Group();
$allGroups
=
$customer_group
->getCollection()->toOptionHash();
foreach
(
$allGroups
as
$key
=>
$allGroup
){
$customerGroup
[
$key
]=
array
(
'value'
=>
$allGroup
,
'label'
=>
$allGroup
);
}
return
$customerGroup
;
What if i want to set 'value'=> to be this groups ID. Can you show an examle, how to do that? Thanks.
ReplyDeleteNever *ever* use "new" to instantiate models, that's just very bad practise.
ReplyDeleteHere is a much cleaner solution : Mage::getResourceModel('customer/group_collection')->toOptionHash();
This is a great post. I like this topic.This site has lots of advantage. It helps me in many ways.Thanks for posting this again.
ReplyDeletemagento development company in bangalore