Hi!
How to display the unit of weight (kg., gr., oz., ml.,) in product page in Opencart 2.0.2.0
Now only displays a number without units.
I'm Using the default template
in file template\product\product.tpl it looks like this:
...<li><?php echo $text_model; ?> <?php echo $model; ?></li>
<?php if ($weight) { ?>
<li><?php echo $text_weight; ?>
<?php
echo round($weight, 2)?></li>
<?php } ?> ...
in
catalog\controller\product\product.php
I have added the line
$data['text_weight'] = $this->language->get('text_weight');
$data['weight'] = $product_info['weight'];
what else need to add or perhaps change ?
Try something like in default OpenCart code.
Step 1
Open file
catalog/controller/product/product.php
Find (around line 242):
Add after :
Step 2
In the same file
catalog/controller/product/product.php
Find (around line 270):
Add after :
Step 3
Open file
catalog/language/english/product/product.php
Find (around line 6):
Add after :
Step 4
Open file
catalog/view/theme/default(your theme)/template/product/product.tpl
Find (around line 141):
Add after :
and then check it.