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

758 views Asked by At

Here is the code of register.tpl file. The variable is called and this $action variable called the account/login.php file how to I can change the link of $action variable.

<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>
3

There are 3 answers

0
AudioBubble On

Try searching for $data['action'] variable in controller (register.php). It is there.

0
TheBlackBenzKid On

The solution is below. But please explain WHY you want to change it and maybe someone can offer some consultancy or a better solution...

The file is inside

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

The line is

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

You can change it here if you wish. I would advice caution. Example would be to replace the line with:

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

The path for the html code for the register file in opencart project is:

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