How to view in weight back value in kg?

Hi you go to app folder.
1. Then go to design–> frontend –> yourtheme –> yourtheme –> template –> catalog –>product –>view –> attributes.phtml

there you can find this code : <?php echo $_helper->productAttribute($_product, $_data[‘value’], $_data[‘code’]) ?>

to change

Then add below code :

<?php
$_weightValue = $_data[‘value’];
if($_data[‘code’]==’weight’){ //this attribute code checkup condition
if (is_numeric($_weightValue)) //this attribute value numberic or not checkup condition
{
$_weightValue = round($_weightValue, 2).’ kg’;  //round to 0.00
}
}
?>
<?php echo $_helper->productAttribute($_product, strip_tags($_weightValue), $_data[‘code’]) ?>

That’s all.

© 2020 Spirituality