I have products showing in kg, g, lb, oz.
With thanks to http://forum.opencart.com/viewtopic.php ... 27#p484527 I have managed to get the weight showing on my product page but it shows me the id from the database. I have tried many guesses but it throws white pages or fatal/illegal errors.
I know I am doing it wrong but I'm not sure where. Here's my code:
File: catalog/controller/product/product.php
I added:
Code: Select all
$data['weight_class_id'] = $product_info['weight_class_id'];
I added:
Code: Select all
<li><span data-toggle="tooltip" title="Product weights are estimated">Weight: </span> <?php echo round($weight, 3); ?> <?php echo $weight_class_id; ?></li>
Product 1 shows 10.5 but instead of kg it shows as 10.5 1
Product 2 shows 160 but instead of grams it shows 160 2
I know these are the id in the database table but I can't figure out how to change it to show the unit as 10.5kg or 160g.
Can anyone help with this please?