Skip to content

Instantly share code, notes, and snippets.

@vikramacharya
Created August 4, 2017 11:59
Show Gist options
  • Select an option

  • Save vikramacharya/8785daafa052446a037f7a0c76a00039 to your computer and use it in GitHub Desktop.

Select an option

Save vikramacharya/8785daafa052446a037f7a0c76a00039 to your computer and use it in GitHub Desktop.
Bulk update customer group in Magento ver1
<?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