3
我的註冊頁面的URL如下:www.exmpl.com/index.php?route=account/register
當我填寫所有字段後提交它重定向到登錄頁面,但我想重定向它,謝謝page.How can I do this?如何在opencart 2.0.3.1註冊後重定向用戶?
我的註冊頁面的URL如下:www.exmpl.com/index.php?route=account/register
當我填寫所有字段後提交它重定向到登錄頁面,但我想重定向它,謝謝page.How can I do this?如何在opencart 2.0.3.1註冊後重定向用戶?
該函數(在/catalog/controller/account/register.php中)負責重定向($this->response->redirect($this->url->link('account/success'));
,更精確)。只需要檢查哪個頁面是「謝謝」頁面(我現在不確定)。
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$customer_id = $this->model_account_customer->addCustomer($this->request->post);
// Clear any previous login attempts for unregistered accounts.
$this->model_account_customer->deleteLoginAttempts($this->request->post['email']);
$this->customer->login($this->request->post['email'], $this->request->post['password']);
unset($this->session->data['guest']);
// Add to activity log
$this->load->model('account/activity');
$activity_data = array(
'customer_id' => $customer_id,
'name' => $this->request->post['firstname'] . ' ' . $this->request->post['lastname']
);
$this->model_account_activity->addActivity('register', $activity_data);
$this->response->redirect($this->url->link('account/success'));
}
非常感謝。但我怎麼能重定向它我的謝謝頁面假設我的謝謝你的網頁鏈接:www.exmpl.com/thank-you-page – user1990
你有沒有試圖寫這個?:'謝謝你,而不是'帳戶/ success'?它工作嗎?如果不是,你可以嘗試(可能不是那個好的選擇)用這個替換整個行:'header('location:www.exmpl.com/thank-you-pag');'。它可能工作,但我不確定,因爲我現在無法測試它。 –
請你指導我如何在opencart v2.0中創建一個自定義頁面。我試圖用這個鏈接創建:http://code.tutsplus.com/tutorials/create-a-custom-page-in-opencart--cms-22054是不是? – user1990