2016-03-28 14:46
浏览 34

在OpenCart 2中创建第二个(单独的)注册表单?

I know this has been asked once before but that question did not seem to have an answer within the thread. So I am posting a separate question.

Anyway so I am using OC version . I need to create a second customer registration page which simple will ask them for a email address and password. (no other fields)

So I copied the below files

- catalog/controller/account/register.php
- catalog/model/account/customer.php
- template/account/register.tpl

I renamed the copied files to

- catalog/controller/account/registerb.php
- catalog/model/account/customerb.php
- template/account/registerb.tpl

I then edited the file in public_html/catalog/controller/account/registerb.php with the below to point to my new file

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/registerb.tpl')) {
        $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/account/registerb.tpl', $data));
    } else {
        $this->response->setOutput($this->load->view('default/template/account/registerb.tpl', $data));

I then go to my newly created file at www.fake.com/index.php?route=account/registerb However I get a error code 500 in my google chrome and the page will not load.

So what am I missing?

图片转代码服务由CSDN问答提供 功能建议

我知道之前曾经问过这个问题,但这个问题似乎没有得到答案。 所以我发布了一个单独的问题。

无论如何所以我使用的是OC版本2.1.0.2。 我需要创建第二个客户注册页面,简单地要求他们提供电子邮件地址和密码。 (没有其他字段)


   -  catalog / controller / account / register.php 
- catalog  /model/account/customer.php
- template / account / register.tpl 

我将复制的文件重命名为 < pre> - catalog / controller / account / registerb.php - catalog / model / account / customerb.php - template / account / registerb.tpl \ n

然后我在public_html / catalog / controller / account / registerb.php 中编辑了该文件,并指向我的新文件

  if(file_exists(DIR_TEMPLATE)  。$ this-&gt; config-&gt; get('config_template')。'/ template /account / registerb.tpl')){
 $ this-&gt; response-&gt; setOutput($ this-&gt; load-  &gt;查看($ this-&gt; config-&gt; get('config_template')。'/ template /account / registerb.tpl',$ data)); 
} else {
 $ this-&gt; response-  &gt; setOutput($ this-&gt; load-&gt; view('default / template / account / registerb.tpl',$ data)); 
 < 然后我转到我新创建的文件

所以我错过了什么 ?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dqd54099 2016-03-29 21:53

    The 500 Internal Server Error is a very general HTTP status code that means something has gone wrong on the web site's server but the server could not be more specific on what the exact problem is.

    But I created files for you. At mine server it is working when i run like index.php?route=account/registerb then it is shown like the following images:

    Different Register Form

    Download code from following sites: Download code for separate register page in OpenCart eCommerce

    解决 无用
    打赏 举报

相关推荐 更多相似问题