Extension "Sales Reps and Dealers" by Amasty

I have the User ID of my customer and the Dealer ID of the Dealer I want them to have, how can i programmatically change their dealer to the new one?

In my observer when a customer is successfully registered I grab their ID:

$customerId = $observer->getCustomer()->getId();

Then I load the customer with:

$customer = Mage::getModel('customer/customer')->load($customerId);

At this point I also have the dealer's ID but don't know how to change the customer's dealer to that dealer. It doesn't show as an attribute when I var_export the $customer.


Please use the following php code:

Mage::getModel('amperm/perm')->assignOneCustomer($uid, $cid);


$uid - dealer (user) entity id;
$cid - customer entity id.
  • This doesn't work. Does it matter if I'm trying to do this in an event observer when a customer is successfully registered? – CodingMageSheen Feb 22 '17 at 19:19
  • Wait it may work let me do some testing before up voting your answer – CodingMageSheen Feb 22 '17 at 19:32

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