Post by inject » Tue Jul 10, 2018 2:44 pm

I get this in checkout when there is products in Cart:

Notice: Undefined variable: error_warning in /customers/2/7/6/bjprace.se/httpd.www/catalog/view/theme/default/template/checkout/cart.tpl on line 18

http://www.bjprace.se/index.php?route=checkout/cart

Everything is working but dont want to have this error warning in webshop.

I have 2.0.3.1

Cart.tpl looks like this:

<?php echo $header; ?>
<div class="container">
<ul class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
<?php } ?>
</ul>
<?php if ($attention) { ?>
<div class="alert alert-info"><i class="fa fa-info-circle"></i> <?php echo $attention; ?>
<button type="button" class="close" data-dismiss="alert">&times;</button>
</div>
<?php } ?>
<?php if ($success) { ?>
<div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?>
<button type="button" class="close" data-dismiss="alert">&times;</button>
</div>
<?php } ?>
<?php if ($error_warning) { ?>
<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
<button type="button" class="close" data-dismiss="alert">&times;</button>
</div>
<?php } ?>
<div class="row"><?php echo $column_left; ?>
<?php if ($column_left && $column_right) { ?>
<?php $class = 'col-sm-6'; ?>
<?php } elseif ($column_left || $column_right) { ?>
<?php $class = 'col-sm-9'; ?>
<?php } else { ?>
<?php $class = 'col-sm-12'; ?>
<?php } ?>
<div id="content" class="<?php echo $class; ?>"><?php echo $content_top; ?>
<h1><?php echo $heading_title; ?>
<?php if ($weight) { ?>
&nbsp;(<?php echo $weight; ?>)
<?php } ?>
</h1>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<td class="text-center"><?php echo $column_image; ?></td>
<td class="text-left"><?php echo $column_name; ?></td>
<td class="text-left"><?php echo $column_model; ?></td>
<td class="text-left"><?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-center"><?php if ($product['thumb']) { ?>
<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a>
<?php } ?></td>
<td class="text-left"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
<?php if (!$product['stock']) { ?>
<span class="text-danger">***</span>
<?php } ?>
<?php if ($product['option']) { ?>
<?php foreach ($product['option'] as $option) { ?>
<br />
<small><?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>
<?php } ?>
<?php } ?>
<?php if ($product['reward']) { ?>
<br />
<small><?php echo $product['reward']; ?></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-left"><div class="input-group btn-block" style="max-width: 200px;">
<input type="text" name="quantity[<?php echo $product['key']; ?>]" value="<?php echo $product['quantity']; ?>" size="1" class="form-control" />
<span class="input-group-btn">
<button type="submit" data-toggle="tooltip" title="<?php echo $button_update; ?>" class="btn btn-primary"><i class="fa fa-refresh"></i></button>
<button type="button" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger" onclick="cart.remove('<?php echo $product['key']; ?>');"><i class="fa fa-times-circle"></i></button></span></div></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 $vouchers) { ?>
<tr>
<td></td>
<td class="text-left"><?php echo $vouchers['description']; ?></td>
<td class="text-left"></td>
<td class="text-left"><div class="input-group btn-block" style="max-width: 200px;">
<input type="text" name="" value="1" size="1" disabled="disabled" class="form-control" />
<span class="input-group-btn"><button type="button" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger" onclick="voucher.remove('<?php echo $vouchers['key']; ?>');"><i class="fa fa-times-circle"></i></button></span></div></td>
<td class="text-right"><?php echo $vouchers['amount']; ?></td>
<td class="text-right"><?php echo $vouchers['amount']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</form>
<?php if ($coupon || $voucher || $reward || $shipping) { ?>
<h2><?php echo $text_next; ?></h2>
<p><?php echo $text_next_choice; ?></p>
<div class="panel-group" id="accordion"><?php echo $coupon; ?><?php echo $voucher; ?><?php echo $reward; ?><?php echo $shipping; ?></div>
<?php } ?>
<br />
<div class="row">
<div class="col-sm-4 col-sm-offset-8">
<table class="table table-bordered">
<?php foreach ($totals as $total) { ?>
<tr>
<td class="text-right"><strong><?php echo $total['title']; ?>:</strong></td>
<td class="text-right"><?php echo $total['text']; ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
<div class="buttons">
<div class="pull-left"><a href="<?php echo $continue; ?>" class="btn btn-default"><?php echo $button_shopping; ?></a></div>
<div class="pull-right"><a href="<?php echo $checkout; ?>" class="btn btn-primary"><?php echo $button_checkout; ?></a></div>
</div>
<?php echo $content_bottom; ?></div>
<?php echo $column_right; ?></div>
</div>
<?php echo $footer; ?>

Newbie

Posts

Joined
Tue Jul 10, 2018 2:36 pm

Post by Qphoria » Tue Jul 10, 2018 10:41 pm

The main catalog/controller/checkout/cart.php file should have a block of code like this

Code: Select all

if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) {
	$data['error_warning'] = $this->language->get('error_stock');
} elseif (isset($this->session->data['error'])) {
	$data['error_warning'] = $this->session->data['error'];

	unset($this->session->data['error']);
} else {
	$data['error_warning'] = '';
}
That appears to be missing or perhaps some vQmod is altering the file and breaking it. Do you have a version of the checkout/cart file in the vqmod/vqcache folder? (vq2-catalog_controller_checkout_cart.php) ?

You may need to go through your xml files and move them into a subfolder one by one, refreshing the page each time to see at what point the error goes away.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 12 guests