V 2.3.0.2 PHP Notice: Undefined variable: class
Posted: Wed Jan 03, 2018 8:15 am
Hello,
Happy New Year to all!
I have a 2.3.0.2 built and keep getting the PHP Notice: Undefined variable: class in.... the error logs when everytime visit the page:
https://www.cosmoracing.com/index.php?r ... ct/special
Can anyone have a dig for me please.
Thank you all one million!
PHP Notice: Undefined variable: class in \catalog\view\theme\template\product\special.tpl on line 21
special.tpl below:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<?php echo $header; ?>
<section class="product-page">
<div class="container">
<div class="row">
<div class="col-md-12">
<ol class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
<?php } ?>
</ol>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12">
<h3 class="page-sec-title"><?php echo $heading_title; ?></h3>
</div>
</div>
<div class="clearfix"> </div>
<div class="row" id="content">
<div class="form-group">
<label class="control-label" for="input-search"><?php echo $entry_search; ?></label>
<div class="row">
<div class="col-sm-4">
<input type="text" name="search" value="<?php echo $search; ?>" placeholder="<?php echo $text_keyword; ?>" id="input-search" class="form-control" />
</div>
<div class="col-sm-3">
<select name="category_id" class="form-control">
<option value="0"><?php echo $text_category; ?></option>
<?php foreach ($categories as $category_1) { ?>
<?php if ($category_1['category_id'] == $category_id) { ?>
<option value="<?php echo $category_1['category_id']; ?>" selected="selected"><?php echo $category_1['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $category_1['category_id']; ?>"><?php echo $category_1['name']; ?></option>
<?php } ?>
<?php foreach ($category_1['children'] as $category_2) { ?>
<?php if ($category_2['category_id'] == $category_id) { ?>
<option value="<?php echo $category_2['category_id']; ?>" selected="selected"> <?php echo $category_2['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $category_2['category_id']; ?>"> <?php echo $category_2['name']; ?></option>
<?php } ?>
<?php foreach ($category_2['children'] as $category_3) { ?>
<?php if ($category_3['category_id'] == $category_id) { ?>
<option value="<?php echo $category_3['category_id']; ?>" selected="selected"> <?php echo $category_3['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $category_3['category_id']; ?>"> <?php echo $category_3['name']; ?></option>
<?php } ?>
<?php } ?>
<?php } ?>
<?php } ?>
</select>
</div>
<div class="col-sm-3">
<label class="checkbox-inline">
<?php if ($sub_category) { ?>
<input type="checkbox" name="sub_category" value="1" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="sub_category" value="1" />
<?php } ?>
<?php echo $text_sub_category; ?></label>
</div>
</div>
</div>
<p>
<label class="checkbox-inline">
<?php if ($description) { ?>
<input type="checkbox" name="description" value="1" id="description" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="description" value="1" id="description" />
<?php } ?>
<?php echo $entry_description; ?></label>
</p>
<input type="button" value="<?php echo $button_search; ?>" id="button-search" class="btn btn-blue no-border-radius" />
<h2><?php echo $text_search; ?></h2>
<?php if ($products) { ?>
<hr/ style=" margin-top:5px;">
<div class="row">
<?php foreach ($products as $product) { ?>
<div class="col-sm-3 prductlst">
<div class="product-Category">
<div class="category-img">
<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>"/></a>
</div>
<div class="product-txt">
<p><a href="<?php echo $product['href']; ?>"><strong><?php echo $product['name']; ?></strong></a></p>
<p><?php echo $product['description']; ?></p>
<p class="price">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
<?php } ?>
<?php if ($product['tax']) { ?>
<span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
<?php } ?>
</p>
<?php
if($product['quantity'] < 1 || $product['stock_status_id'] == 5 || ( $product['minimum'] > $product['quantity']))
{
?>
<p class="text-danger"><?php echo $text_outstock; ?></p>
<?php
}
else
{
?>
<p><button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');" class="btn btn-blue"><?php echo $button_buy;?></button></p>
<?php
}
?>
</div>
</div>
</div>
<?php } ?>
</div>
<div class="row">
<div class="col-sm-6 text-left"><?php echo $pagination; ?></div>
<div class="col-sm-6 text-right"><?php echo $results; ?></div>
</div>
<?php } else { ?>
<p><?php echo $text_empty; ?></p>
<?php } ?>
</div>
</div>
</section>
<script type="text/javascript"><!--
$('#button-search').bind('click', function() {
url = 'index.php?route=product/search';
var search = $('#content input[name=\'search\']').prop('value');
if (search) {
url += '&search=' + encodeURIComponent(search);
}
var category_id = $('#content select[name=\'category_id\']').prop('value');
if (category_id > 0) {
url += '&category_id=' + encodeURIComponent(category_id);
}
var sub_category = $('#content input[name=\'sub_category\']:checked').prop('value');
if (sub_category) {
url += '&sub_category=true';
}
var filter_description = $('#content input[name=\'description\']:checked').prop('value');
if (filter_description) {
url += '&description=true';
}
location = url;
});
$('#content input[name=\'search\']').bind('keydown', function(e) {
if (e.keyCode == 13) {
$('#button-search').trigger('click');
}
});
$('select[name=\'category_id\']').on('change', function() {
if (this.value == '0') {
$('input[name=\'sub_category\']').prop('disabled', true);
} else {
$('input[name=\'sub_category\']').prop('disabled', false);
}
});
$('select[name=\'category_id\']').trigger('change');
--></script>
<?php echo $footer; ?>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end
Happy New Year to all!
I have a 2.3.0.2 built and keep getting the PHP Notice: Undefined variable: class in.... the error logs when everytime visit the page:
https://www.cosmoracing.com/index.php?r ... ct/special
Can anyone have a dig for me please.
Thank you all one million!
PHP Notice: Undefined variable: class in \catalog\view\theme\template\product\special.tpl on line 21
special.tpl below:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<?php echo $header; ?>
<section class="product-page">
<div class="container">
<div class="row">
<div class="col-md-12">
<ol class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
<?php } ?>
</ol>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12">
<h3 class="page-sec-title"><?php echo $heading_title; ?></h3>
</div>
</div>
<div class="clearfix"> </div>
<div class="row" id="content">
<div class="form-group">
<label class="control-label" for="input-search"><?php echo $entry_search; ?></label>
<div class="row">
<div class="col-sm-4">
<input type="text" name="search" value="<?php echo $search; ?>" placeholder="<?php echo $text_keyword; ?>" id="input-search" class="form-control" />
</div>
<div class="col-sm-3">
<select name="category_id" class="form-control">
<option value="0"><?php echo $text_category; ?></option>
<?php foreach ($categories as $category_1) { ?>
<?php if ($category_1['category_id'] == $category_id) { ?>
<option value="<?php echo $category_1['category_id']; ?>" selected="selected"><?php echo $category_1['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $category_1['category_id']; ?>"><?php echo $category_1['name']; ?></option>
<?php } ?>
<?php foreach ($category_1['children'] as $category_2) { ?>
<?php if ($category_2['category_id'] == $category_id) { ?>
<option value="<?php echo $category_2['category_id']; ?>" selected="selected"> <?php echo $category_2['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $category_2['category_id']; ?>"> <?php echo $category_2['name']; ?></option>
<?php } ?>
<?php foreach ($category_2['children'] as $category_3) { ?>
<?php if ($category_3['category_id'] == $category_id) { ?>
<option value="<?php echo $category_3['category_id']; ?>" selected="selected"> <?php echo $category_3['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $category_3['category_id']; ?>"> <?php echo $category_3['name']; ?></option>
<?php } ?>
<?php } ?>
<?php } ?>
<?php } ?>
</select>
</div>
<div class="col-sm-3">
<label class="checkbox-inline">
<?php if ($sub_category) { ?>
<input type="checkbox" name="sub_category" value="1" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="sub_category" value="1" />
<?php } ?>
<?php echo $text_sub_category; ?></label>
</div>
</div>
</div>
<p>
<label class="checkbox-inline">
<?php if ($description) { ?>
<input type="checkbox" name="description" value="1" id="description" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="description" value="1" id="description" />
<?php } ?>
<?php echo $entry_description; ?></label>
</p>
<input type="button" value="<?php echo $button_search; ?>" id="button-search" class="btn btn-blue no-border-radius" />
<h2><?php echo $text_search; ?></h2>
<?php if ($products) { ?>
<hr/ style=" margin-top:5px;">
<div class="row">
<?php foreach ($products as $product) { ?>
<div class="col-sm-3 prductlst">
<div class="product-Category">
<div class="category-img">
<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>"/></a>
</div>
<div class="product-txt">
<p><a href="<?php echo $product['href']; ?>"><strong><?php echo $product['name']; ?></strong></a></p>
<p><?php echo $product['description']; ?></p>
<p class="price">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
<?php } ?>
<?php if ($product['tax']) { ?>
<span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
<?php } ?>
</p>
<?php
if($product['quantity'] < 1 || $product['stock_status_id'] == 5 || ( $product['minimum'] > $product['quantity']))
{
?>
<p class="text-danger"><?php echo $text_outstock; ?></p>
<?php
}
else
{
?>
<p><button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');" class="btn btn-blue"><?php echo $button_buy;?></button></p>
<?php
}
?>
</div>
</div>
</div>
<?php } ?>
</div>
<div class="row">
<div class="col-sm-6 text-left"><?php echo $pagination; ?></div>
<div class="col-sm-6 text-right"><?php echo $results; ?></div>
</div>
<?php } else { ?>
<p><?php echo $text_empty; ?></p>
<?php } ?>
</div>
</div>
</section>
<script type="text/javascript"><!--
$('#button-search').bind('click', function() {
url = 'index.php?route=product/search';
var search = $('#content input[name=\'search\']').prop('value');
if (search) {
url += '&search=' + encodeURIComponent(search);
}
var category_id = $('#content select[name=\'category_id\']').prop('value');
if (category_id > 0) {
url += '&category_id=' + encodeURIComponent(category_id);
}
var sub_category = $('#content input[name=\'sub_category\']:checked').prop('value');
if (sub_category) {
url += '&sub_category=true';
}
var filter_description = $('#content input[name=\'description\']:checked').prop('value');
if (filter_description) {
url += '&description=true';
}
location = url;
});
$('#content input[name=\'search\']').bind('keydown', function(e) {
if (e.keyCode == 13) {
$('#button-search').trigger('click');
}
});
$('select[name=\'category_id\']').on('change', function() {
if (this.value == '0') {
$('input[name=\'sub_category\']').prop('disabled', true);
} else {
$('input[name=\'sub_category\']').prop('disabled', false);
}
});
$('select[name=\'category_id\']').trigger('change');
--></script>
<?php echo $footer; ?>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end