I am trying to update seller's group id in my multi-seller Magento website.

function becomesellerAction() {
$adminApproval = Mage::getStoreConfig('marketplace/admin_approval_seller_registration/need_approval');
$approval = 0;
if ($adminApproval == 1) {
    $approval = 0;
} else {
    $approval = 1;
$getGroupId = Mage::helper('marketplace')->getGroupId();
$customer = Mage::getSingleton("customer/session")->getCustomer();

In the log, I do see $getGroupId=4 which is what I want. But the database continues to have the default value of 1. Basically this is not saving the value to the database. The table in the database where this needs to be saved is 'customer_entity'.

I tried using a direct query:

$resource = Mage::getSingleton('core/resource');
$writeConnection = $resource->getConnection('core_write');
$getGroupId = Mage::helper('marketplace')->getGroupId();
$email = $customer->getEmail();
$query = "UPDATE customer_entity SET group_id = '{$getGroupId}' WHERE email = '{$email}'";
Mage::log($query, null,'query.log');


And this works fine in all environments.

Strangely the original code works fine in my local but not in test or production (local is WAMP and prod/test is Apache/Linux).

Any pointers to what am I doing wrong here? Is there a log that gets created when such save() operations fail?


1 Answer 1


it may be an Observer that stops it from saving. Impossible to specify it exactly.

You could start here and see what happens when you call save: https://github.com/bragento/magento-core/blob/1264aee821b451b3c88e55659cd1ee79d3b324af/app/code/core/Mage/Core/Model/Abstract.php#L317

  • I put the try / catch but it gives no error. In fact it gives a success message. I guess I will have to live with the direct query for now ... but its very perplexing Commented Feb 14, 2016 at 2:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.