I am currently working on an ecommerce website using opencart, trying to show the weight of each product, in product details template it works, however, when I do the same thing to the product block, it shows undefined variable. This is the site KCityMart
So what I did to show the weight in product details page is this
in file catalog/controller/product/product.php I added this
$data['weight'] = $this->weight->format($product_info['weight'],$product_info['weight_class_id']);
and in /catalog/view/theme/theme/template/product/product.tpl I added this
<ul class="volume">
<?php if ($weight > 0) { ?>
<li><?php echo $weight; ?></li>
<?php } ?>
</ul>
and it works. But, when I tried to add this to /catalog/view/theme/theme/template/common/product/default.tpl it shows "undefined variable" error.
What could be the problem? Which part did I miss?
Any input from you all will be very much appreciated. Thanks!