Is there an event for customer account registration in Magento?

后端 未结 17 1866
轻奢々
轻奢々 2020-12-04 17:23

I would like to be able to run some functionality with a module that I am building whenever a customer registers an account, but I can\'t seem to f

相关标签:
17条回答
  • 2020-12-04 17:32

    You can try customer_save_after, the only thing that the registration sends this event twice

    0 讨论(0)
  • 2020-12-04 17:32

    You can use the customer_register_success event. It is triggered after the customer is succesfully created. Here is the link of event cheat sheets. Hope it also helps you.

    http://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/
    
    0 讨论(0)
  • 2020-12-04 17:34

    The answer to this question is that there isn't an event for that.

    0 讨论(0)
  • 2020-12-04 17:34

    customer_save_after is the event which gets called after a new customer registration.

    Read about all the events here:

    http://www.magentocommerce.com/wiki/5_-_modules_and_development/reference/events

    0 讨论(0)
  • 2020-12-04 17:35

    I discovered how to achieve this today. It involves using one of the generic controller events. This node in the config.xml will hook into the right event:

    <events>
     ....
      <controller_action_postdispatch_customer_account_createPost>
        <observers>
         <your_module_here>...etc
    

    The controller_action_postdispatch_REQUESTPATH event is thrown for every controller that extends Mage_Core_Controller_Front_Action (which is basically all of them) which makes it very easy to target. Ditto for controller_action_predispatch_REQUESTPATH.

    0 讨论(0)
  • customer_register_success is the event dispatched after successful customer registration.
    Here's from the code from Mage/Customer/controllers/AccountController.php::454 in magento 1.8:

    protected function _dispatchRegisterSuccess($customer)
    {
        Mage::dispatchEvent('customer_register_success',
            array('account_controller' => $this, 'customer' => $customer)
        );
    }
    
    0 讨论(0)
提交回复
热议问题