繁体   English   中英

如何在opencart register.tpl文件中编辑变量的链接?

[英]How to edit the link of a variable in opencart register.tpl file?

这是register.tpl文件的代码。 该变量被调用,该$ action变量称为account / login.php文件,我该如何更改$ action变量的链接。

<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
    <h2><?php echo $text_your_details; ?></h2>
    <div class="content">
      <table class="form">
        <tr>
          <td><span class="required">*</span> <?php echo $entry_firstname; ?></td>
          <td><input type="text" name="firstname" value="<?php echo $firstname; ?>" />
            <?php if ($error_firstname) { ?>
            <span class="error"><?php echo $error_firstname; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_lastname; ?></td>
          <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" />
            <?php if ($error_lastname) { ?>
            <span class="error"><?php echo $error_lastname; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_email; ?></td>
          <td><input type="text" name="email" value="<?php echo $email; ?>" />
            <?php if ($error_email) { ?>
            <span class="error"><?php echo $error_email; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_telephone; ?></td>
          <td><input type="text" name="telephone" value="<?php echo $telephone; ?>" />
            <?php if ($error_telephone) { ?>
            <span class="error"><?php echo $error_telephone; ?></span>
            <?php } ?></td>
        </tr>

尝试在控制器(register.php)中搜索$ data ['action']变量。 在那里。

解决方案如下。 但是请解释为什么要更改它,也许有人可以提供一些咨询或更好的解决方案...

文件在里面

/opencart/catalog/controller/account/register.php

该行是

$data['action'] = $this->url->link('account/register', '', 'SSL');

您可以根据需要在此处进行更改。 我建议谨慎。 例如,将行替换为:

// #CORECHANGE - Find later for upgrading
//$data['action'] = $this->url->link('account/register', '', 'SSL');
$newRegisterActionURL = "account/register/epos";
$data['action'] = $this->url->link($newRegisterActionURL, '', 'SSL');

opencart项目中注册文件的html代码的路径为:

/public_html/catalog/view/theme/megashop/template/account/register.tpl

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM