开发者

Determine when a new customer registers from within custom module (Magento)

开发者 https://www.devze.com 2023-04-13 05:58 出处:网络
I am working on a module that will allow the customer to not only sign up with our webstore, but also give them the ability to register with another site via a web service. How do I determine, from wi

I am working on a module that will allow the customer to not only sign up with our webstore, but also give them the ability to register with another site via a web service. How do I determine, from within my module, when a customer is registering so that I can send the approp开发者_运维百科riate information off to the other site?


Magento has a good event system that dispatches events to registered observers when they occur. This allows you to do exactly what you want.

Take a look at customer_register_success event ( app/code/core/Mage/Customer/controllers/AccountController.php : 322 )

More on event/observer pattern in magento:

http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/customizing_magento_using_event-observer_method


actually there is no event for user registring Ok, there is one (see code_burgar's answer), but it ain't fired when customer register during checkout. So your best shot is the customer_save_before and check if there is an id (if there is not, it means he's new)

0

精彩评论

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

关注公众号