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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -