Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Affect all Magento customers to a group
<?php
$customerGroupId = SOME_CUSTOMER_GROUP_ID;
$table = Mage::getModel('customer/customer')->getResource()
->getWriteConnection()
->getTable('customer/entity');
$query = "UPDATE {$table} SET group_id = {$customerGroupId} WHERE group_id != {$customerGroupId}";
$conn->query($query);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment