Posts Tagged ‘options’

// Add the attribute code here.
$attribute=$product->getResource()->getAttribute("color");
// Checking if the attribute is either select or multiselect type.
if($attribute->usesSource()){
// Getting all the sources (options)
$options = $attribute->getSource()->getAllOptions(false);
}
// print as label-value pair
echo '<pre>'. print_r($options) .'</pre>';

Thanks,
– Bijal Bhavsar 🙂