Coding

Magento: get option id from Label of Multi select

     function getOptionId($attributeCode, $optionLabel) {

        $optionId = '';
        $attr = Mage::getModel('catalog/product')->getResource()->getAttribute($attributeCode);
        if ($attr->usesSource()) {
            $optionId = $attr->getSource()->getOptionId($optionLabel);
        }
        
        return $optionId;
    }

0 Bình luận

Trở về
  • HTML5 Canvas
  • HTML5 Canvas

     The <canvas> element is used to draw graphics, on the fly, on a web page. Draw a red rectangle, a gradient rectangle,...