Issue
I've got a Shopping Cart Price Rule allowed for one Customer Group.
How can I get this Customer Group id programmatically?
Solution
Try below code to retrieve customer id which is allowed for customer group.
$rules = Mage::getResourceModel('salesrule/rule_collection')->load();
foreach ($rules as $rule) {
if ($rule->getIsActive()) {
$rule = Mage::getModel('salesrule/rule')->load($rule->getId());
$customer_ids = $rule->getData('customer_group_ids');
}
}
You will have customer group id array.
Answered By - Mufaddal Answer Checked By - David Goodson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.