开发者

is there a central way for programmatically doing customer account creation in magento?

i need to override the customer account creation process.

looking at the Custome开发者_高级运维r Account Controller, I see the createPostAction() method where it seems like multiple things are involved in account creation (addresses, etc.)

but what if customer account creation goes beyond just the form? why is this logic so ingrained into the controller?

looking for ideas/suggestions for how to ultimately override customer account creation...

thanks


There's a SOAP API method for creating a customer.

You can also look at the implementation of the SOAP API method

File: app/code/core/Mage/Customer/Model/Customer/Api.php
public function create($customerData)
{
    $customerData = $this->_prepareData($customerData);
    try {
        $customer = Mage::getModel('customer/customer')
            ->setData($customerData)
            ->save();
    } catch (Mage_Core_Exception $e) {
        $this->_fault('data_invalid', $e->getMessage());
    }
    return $customer->getId();
}

and see where the code that the API calls is run. This is sufficient for creating a customer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜