Programatically add customer in magento

Programatically add customer in magento tested in Magento 1.5.1.0


require_once 'app/Mage.php';
umask(0);
$websiteId = Mage::app()->getWebsite()->getId();
$store = Mage::app()->getStore();
$customer = Mage::getModel("customer/customer");
$customer->website_id = $websiteId;
$customer->setStore($store);
$customer->firstname = "Branko";
$customer->lastname = "Ajzele";
$customer->email = "ajzele@someserver11.com";
$customer->password_hash = md5("mycoolpass");
$customer->save();


Share on Facebook



5 thoughts on “Programatically add customer in magento”