我有一个特殊情况,用户必须通过帐户注册页面(例如/customer/account/create/)注册一个帐户。完成后,如果他们在购物车中有产品,我需要将他们重定向回结帐屏幕。
我目前有一个监听器来监听customer_register_success
事件。观察者通过以下代码将用户帐户升级为成员组:
class Hatclub_MembershipHandler_Model_Observer {
// members group id
const GROUP_ID = 4;
// called when a customer registers for the site
public function registrationSuccess(Varien_Event_Observer $observer) {
// extract customer data from event
$customer = $observer->getCustomer();
// a cookie should have been set with the membership id
if (isset($_COOKIE['membership_account_id'])) {
$customer
->setGroupId(self::GROUP_ID)
->setRmsId($_COOKIE['membership_account_id']);
}
return $this;
}
}
还有其他我可以听的更适合我想做的活动吗?如果有帮助,我也有一个可用的 redirect_to cookie。