In product list weight is 0 gm. I set weight in admin panel, but it's weight show in 0 gm..? I set code in
app/design/frontend/rwd/default/template/catalog/product/list.phtml
code is:
<?php
$_weight = $this->htmlEscape($_product->getWeight());
if ($_weight < 1)
$_weightstr = number_format($_weight*1000) . " gm";
else
$_weightstr = number_format($_weight) . " kg"; echo $_weightstr; ?>
Please help…!
Best Answer
I believe the attribute "weight" does not have the option "Used in product listing" set to "Yes"; this can be checked by a simple
in the
list.phtml
; I guess it givesNULL
.Change "Used in product listing" to "Yes", reindex & clear the cache to solve this issue.