2016-04-08 74 views

回答

2

您可以使用

$customer->logout(); 

或者

$customer->mylogout(); 

第一個是一個完整的退出,第二個會留在客戶的餅乾子公司信息。

兩種方法都會觸發actionCustomerLogoutBeforeactionCustomerLogoutAfter掛鉤,因此您可以將它們附加到它們以進行重定向。

說到重定向 - 這取決於你想要什麼頁面重定向你的客戶,如果它是一個內部頁面,您可以使用:

$redirect_link = Context::getContext()->link->getPageLink(...); // or "getModuleLink", etc., see classes/Link.php for details. 

或者

$redirect_link = $this->context->link->getPageLink(...); 

,那麼你會使用redirect,redirectLinkredirectAdmin(可能是另外兩個,因爲redirectAdmin只有在Back Office中才有意義)Tools類才能重定向到該鏈接。