Created
June 12, 2015 09:50
-
-
Save herveguetin/300ead7f03e88f5ab6b9 to your computer and use it in GitHub Desktop.
Affect all Magento customers to a group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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