1

I have a custom customer attribute and I want to assign a value to that attribute for a specific customer. This is how I get my customer:

$customer_email = "[email protected]";
$customer = Mage::getModel("customer/customer"); 
$customer->setWebsiteId(1);
$customer->loadByEmail($customer_email);

The custom customer attribute id is : cat_id.

How do I add a value to the attribute for a specific customer using its email address? THx

1 Answer 1

2

You can simply use the setter method then save your customer:

$customer_email = "[email protected]";
$customer = Mage::getModel("customer/customer"); 
$customer->setWebsiteId(1);
$customer->loadByEmail($customer_email);
$customer->setCatId($yourId);
$customer->save();

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.