Page 1 of 1

Edit return.php in controller of opencart?

Posted: Mon Jul 04, 2016 1:05 am
by jadenronnie
Helo!

I have edited return.tpl by removing reason to return and opened or not check boxes, Now the problem is as i have removed those codes but controller is noticing as those were rquired fields which can't be empty so the form is not working, can you help me to modify that code so that controller start working. Thanks in advance :)

Re: Edit return.php in controller of opencart?

Posted: Mon Jul 04, 2016 1:45 am
by cyclops12
jadenronnie wrote:Helo!

I have edited return.tpl
what version are you using and what file exactly did you edit as i cant see a return.tpl

also what code did you remove?

Re: Edit return.php in controller of opencart?

Posted: Mon Jul 04, 2016 2:01 am
by OSWorX
Simply remove the checks inside the controller too.

Re: Edit return.php in controller of opencart?

Posted: Mon Jul 04, 2016 2:48 am
by jadenronnie
Hi Thanks guys here is code i edited inside template/account/return_form.tpl

<div class="form-group">
<label class="col-sm-2 control-label" for="input-quantity"><?php echo $entry_quantity; ?></label>
<div class="col-sm-10">
<input type="text" name="quantity" value="<?php echo $quantity; ?>" placeholder="<?php echo $entry_quantity; ?>" id="input-quantity" class="form-control" />
</div>
</div>
DELETED FROM HERE TO:
<div class="form-group required">
<label class="col-sm-2 control-label"><?php echo $entry_reason; ?></label>
<div class="col-sm-10">
<?php foreach ($return_reasons as $return_reason) { ?>
<?php if ($return_reason['return_reason_id'] == $return_reason_id) { ?>
<div class="radio">
<label>
<input type="radio" name="return_reason_id" value="<?php echo $return_reason['return_reason_id']; ?>" checked="checked" />
<?php echo $return_reason['name']; ?></label>
</div>
<?php } else { ?>
<div class="radio">
<label>
<input type="radio" name="return_reason_id" value="<?php echo $return_reason['return_reason_id']; ?>" />
<?php echo $return_reason['name']; ?></label>
</div>
<?php } ?>
<?php } ?>
<?php if ($error_reason) { ?>
<div class="text-danger"><?php echo $error_reason; ?></div>
<?php } ?>
</div>
</div>
<div class="form-group required">
<label class="col-sm-2 control-label"><?php echo $entry_opened; ?></label>
<div class="col-sm-10">
<label class="radio-inline">
<?php if ($opened) { ?>
<input type="radio" name="opened" value="1" checked="checked" />
<?php } else { ?>
<input type="radio" name="opened" value="1" />
<?php } ?>
<?php echo $text_yes; ?></label>
<label class="radio-inline">
<?php if (!$opened) { ?>
<input type="radio" name="opened" value="0" checked="checked" />
<?php } else { ?>
<input type="radio" name="opened" value="0" />
<?php } ?>
<?php echo $text_no; ?></label>
</div>
</div>
TO HERE
<div class="form-group">
<label class="col-sm-2 control-label" for="input-comment"><?php echo $entry_fault_detail; ?></label>
<div class="col-sm-10">
<textarea name="comment" rows="10" placeholder="<?php echo $entry_fault_detail; ?>" id="input-comment" class="form-control"><?php echo $comment; ?></textarea>

and changed into

Code: Select all

          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-quantity"><?php echo $entry_quantity; ?></label>
            <div class="col-sm-9">
              <input type="text" name="quantity" value="<?php echo $quantity; ?>" placeholder="<?php echo $entry_quantity; ?>" id="input-quantity" class="form-control" />
            </div>
          </div>
          <div class="form-group" required>
            <label class="col-sm-2 control-label" for="input-comment"><?php echo $entry_fault_detail; ?></label>
            <div class="col-sm-9">
              <textarea name="comment" rows="10" placeholder="<?php echo $entry_fault_detail; ?>" id="input-comment" class="form-control"><?php echo $comment; ?></textarea>

Re: Edit return.php in controller of opencart?

Posted: Mon Jul 04, 2016 2:53 am
by jadenronnie
Also OC version is 2.0.1.0

Re: Edit return.php in controller of opencart?

Posted: Mon Jul 04, 2016 2:55 am
by jadenronnie
OSWorX wrote:Simply remove the checks inside the controller too.
I'm not sure about which codes do i have to remove, i tried but not working

Re: Edit return.php in controller of opencart?

Posted: Mon Jul 04, 2016 7:35 am
by straightlight
The subject you're reporting is not about a bug but modifications you wish to add.