php - Magento: Reading attribute -
i have added new attribute labels in magento , modified file labels.phtml. if attribute set yes in backend , item sale item, want display different label. code following, not getting result:
if (($issale == true) && ($product->getattributetext('clearance') == yes)) { $html .= '<span class="sticker-wrapper top-right"><span class="sticker sale">' . $this->__('clearance') . '</span> </span>'; }
any idea doing wrong?
magento stores yes/no values 1/0. try change condition:
if (($issale == true) && ($product->getattributetext('clearance') == "yes"))
to
if (($issale == true) && ($product->getattributetext('clearance') === "1"))
Comments
Post a Comment