Post by chruptor1 » Thu Aug 31, 2017 4:35 pm

Hello,

i have a problem with my opencart 2.0.3.1 store.
Any product gives the same result. Im posting error log below. This log shows after you hit continue button on payment method page:

Internal Server Error

Internal Server Error

<div class="table-responsive">

<table class="table table-bordered table-hover">

<thead>

<tr>

<td class="text-left">Product Name</td>

<td class="text-left">Model</td>

<td class="text-right">Quantity</td>

<td class="text-right">Unit Price</td>

<td class="text-right">Total</td>

</tr>

</thead>

<tbody>

<tr>

<td class="text-left"><a href="http://www.cleversteps.eu/index.php?rou ... 7">Century: Spice Road Bags of Spices Set</a>

<br />

&nbsp;<small> - Version: XXL</small>

</td>

<td class="text-left">Century: Spice Road Bags of Spices Set</td>

<td class="text-right">1</td>

<td class="text-right">€ 44.99</td>

<td class="text-right">€ 44.99</td>

</tr>

</tbody>

<tfoot>

<tr>

<td colspan="4" class="text-right"><strong>Sub-Total:</strong></td>

<td class="text-right">€ 36.58</td>

</tr>

<tr>

<td colspan="4" class="text-right"><strong>Flat Shipping Rate:</strong></td>

<td class="text-right">€ 6.00</td>

</tr>

<tr>

<td colspan="4" class="text-right"><strong>VAT (23%):</strong></td>

<td class="text-right">€ 9.79</td>

</tr>

<tr>

<td colspan="4" class="text-right"><strong>Total:</strong></td>

<td class="text-right">€ 52.37</td>

</tr>

</tfoot>

</table>

</div>

<h2>Bank Transfer Instructions</h2>
<p><b>Please transfer the total amount to the following bank account.</b></p>
<div class="well well-sm">
<p>After receiving invoice transfer payment to:<br />

<br />

<br />

Akademickie Inkubatory Przedsiębiorczości<br />

ul. Piękna 68, 00-672 Warszawa, Polska<br />

NIP: PL5242495143<br />

<br />

pl92114010100000515853002349<br />

<br />

<br />

or use PayPal payment to:<br />

<br />

cleversteps.boardgames@gmail.com<br />

<br />

</p>
<p>Your order will not ship until we receive payment.</p>
</div>
<div class="buttons">
<div class="pull-right">
<input type="button" value="Confirm Order" id="button-confirm" class="btn btn-primary" data-loading-text="Loading..." />
</div>
</div>
<script type="text/javascript"><!--
$('#button-confirm').on('click', function() {
$.ajax({
type: 'get',
url: 'index.php?route=payment/bank_transfer/confirm',
cache: false,
beforeSend: function() {
$('#button-confirm').button('loading');
},
complete: function() {
$('#button-confirm').button('reset');
},
success: function() {
location = 'http://www.cleversteps.eu/index.php?rou ... ut/success';
}
});
});
//--></script>
<b>Notice</b>: Undefined property: Loader::$cart in <b>/home/oglowacka/ftp/sklep/sklep/upload/catalog/view/theme/default/template/checkout/confirm.tpl</b> on line <b>57</b>
Can anyone tell me how to fix this problem?

Thanks,
G.

Newbie

Posts

Joined
Thu Aug 31, 2017 4:31 pm

Post by grgr » Sat Sep 02, 2017 9:43 pm

What's on line 57? The default files only has 56 line.

Image Image Image Image Image Image


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm

Post by MrPhil » Sun Sep 03, 2017 9:34 pm

grgr wrote:
Sat Sep 02, 2017 9:43 pm
What's on line 57? The default files only has 56 line.
Very likely there is a blank or empty line after the last closing ?>, making an invisible line 57. Go in with a good editor and carefully delete everything after the ?>, even if it looks like there is nothing there. You might find it easiest to erase the > and everything after, and then type the > back in. Save the file and see if matters have improved.

How did this blank or empty line get there? Usually it's a faulty editor; sometimes it's a faulty FTP client; and sometimes it's a finger check by someone doing editing.

Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by chruptor1 » Mon Sep 04, 2017 3:35 pm

That is my confirm file. As you can see there are some visible lines after 57th. Im not sure if i really have to delet them, or is there just a small typo.

Code: Select all

[size=50]<?php if (!isset($redirect)) { ?>
<div class="table-responsive">
  <table class="table table-bordered table-hover">
    <thead>
      <tr>
        <td class="text-left"><?php echo $column_name; ?></td>
        <td class="text-left"><?php echo $column_model; ?></td>
        <td class="text-right"><?php echo $column_quantity; ?></td>
        <td class="text-right"><?php echo $column_price; ?></td>
        <td class="text-right"><?php echo $column_total; ?></td>
      </tr>
    </thead>
    <tbody>
      <?php foreach ($products as $product) { ?>
      <tr>
        <td class="text-left"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
          <?php foreach ($product['option'] as $option) { ?>
          <br />
          &nbsp;<small> - <?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>
          <?php } ?>
          <?php if($product['recurring']) { ?>
          <br />
          <span class="label label-info"><?php echo $text_recurring_item; ?></span> <small><?php echo $product['recurring']; ?></small>
          <?php } ?></td>
        <td class="text-left"><?php echo $product['model']; ?></td>
        <td class="text-right"><?php echo $product['quantity']; ?></td>
        <td class="text-right"><?php echo $product['price']; ?></td>
        <td class="text-right"><?php echo $product['total']; ?></td>
      </tr>
      <?php } ?>
      <?php foreach ($vouchers as $voucher) { ?>
      <tr>
        <td class="text-left"><?php echo $voucher['description']; ?></td>
        <td class="text-left"></td>
        <td class="text-right">1</td>
        <td class="text-right"><?php echo $voucher['amount']; ?></td>
        <td class="text-right"><?php echo $voucher['amount']; ?></td>
      </tr>
      <?php } ?>
    </tbody>
    <tfoot>
      <?php foreach ($totals as $total) { ?>
      <tr>
        <td colspan="4" class="text-right"><strong><?php echo $total['title']; ?>:</strong></td>
        <td class="text-right"><?php echo $total['text']; ?></td>
      </tr>
      <?php } ?>
    </tfoot>
  </table>
</div>
<?php echo $payment; ?>
<?php } else { ?>
<script type="text/javascript"><!--
location = '<?php echo $redirect; ?>';
//--></script>
<?php } ?>
<?php if ($this->cart->getSubtotal() >= 15) { ?>
<div class="payment"><?php echo $payment; ?></div>
<?php } else { ?>
<div class="warning">Minimum Order on this site is 15 $</div>
<?php } ?>[/size]

Newbie

Posts

Joined
Thu Aug 31, 2017 4:31 pm

Post by MrPhil » Mon Sep 04, 2017 10:11 pm

I cleaned up the code, as I can't stand constant jumping in and out of PHP mode:

Code: Select all

<?php 
if (!isset($redirect)) {
?>
<div class="table-responsive">
  <table class="table table-bordered table-hover">
    <thead>
      <tr>
        <td class="text-left"><?php echo $column_name; ?></td>
        <td class="text-left"><?php echo $column_model; ?></td>
        <td class="text-right"><?php echo $column_quantity; ?></td>
        <td class="text-right"><?php echo $column_price; ?></td>
        <td class="text-right"><?php echo $column_total; ?></td>
      </tr>
    </thead>
    <tbody>
<?php
  foreach ($products as $product) {
    echo "<tr>\n";
    echo "<td class=\"text-left\"><a href=\"$product['href']\">$product['name']</a>\n";
    foreach ($product['option'] as $option) {
      echo "<br />\n";
      echo "&nbsp;<small> - $option['name']: $option['value']</small>\n";
    }
    if ($product['recurring']) {
      echo "<br />\n";
      echo "<span class=\"label label-info\">$text_recurring_item</span> <small>$product['recurring']</small>\n";
    } 
    echo "</td>\n";
    echo "<td class=\"text-left\">$product['model']</td>\n";
    echo "<td class=\"text-right\">$product['quantity']</td>\n";
    echo "<td class=\"text-right\">$product['price']</td>\n";
    echo "<td class=\"text-right\">$product['total']</td>\n";
    echo "</tr>\n";
  }
  foreach ($vouchers as $voucher) {
    echo "<tr>\n";
    echo "  <td class=\"text-left\">$voucher['description']</td>\n";
    echo "  <td class=\"text-left\"></td>\n";
    echo "  <td class=\"text-right\">1</td>\n";
    echo "  <td class=\"text-right\">$voucher['amount']</td>\n";
    echo "  <td class=\"text-right\">$voucher['amount']</td>\n";
    echo "</tr>\n";
  }
  echo "</tbody>\n";
  echo "<tfoot>\n";
  foreach ($totals as $total) {
    echo "  <tr>\n";
    echo "    <td colspan=\"4\" class=\"text-right\"><strong>$total['title']:</strong></td>\n";
    echo "    <td class=\"text-right\">$total['text']</td>\n";
    echo "  </tr>\n";
  }
?>
    </tfoot>
  </table>
</div>
<?php 
echo $payment;
} else {
  echo "<script type=\"text/javascript\"><!--\n";
  echo "location = '$redirect';\n";
  echo "//--></script>\n";
}
if ($this->cart->getSubtotal() >= 15) {
  echo "<div class=\"payment\">$payment</div>\n";
} else {
  echo "<div class=\"warning\">Minimum Order on this site is \$15</div>\n";
}
Your old line 57 contains $this->cart->getSubtotal(). Where is $this defined? It's normally found within Javascript code, and is the object being passed in. Maybe you put some JS code outside of the <script>?

Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by chruptor1 » Mon Sep 04, 2017 11:27 pm

I used your code, and now i get different error: "Internat Server Error", without any useful log... where should i start repairing this?

Newbie

Posts

Joined
Thu Aug 31, 2017 4:31 pm

Post by MrPhil » Tue Sep 05, 2017 10:00 pm

Was that the complete file that you showed earlier? I still don't know where $this is defined, and I suspect that's your original error. My code did not fix it. If you got a 500 error, most likely you have a blank or empty line at the beginning (before the <?php) or end (after the last ?>).

Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by chruptor1 » Thu Sep 07, 2017 3:19 pm

It was complete file. I have no idea what that missing thing means... is there any way to download clean file?

Newbie

Posts

Joined
Thu Aug 31, 2017 4:31 pm
Who is online

Users browsing this forum: kelvinso and 26 guests