Hi with the below code you can get the product custom option attributes all data
$product = Mage::getModel("catalog/product")->load(1); //product id 1
$i = 1;
echo "<pre>";
foreach ($product->getOptions() as $o) {
echo "<strong>Custom Option:" . $i . "</strong><br/>";
echo "Custom Option TITLE: " . $o->getTitle() . "<br/>"; //Colors
echo "Custom Option TYPE: " . $o->getType() . "<br/>"; //drop_down
echo "Custom Option Values: <br/>";
$values = $o->getValues();
foreach ($values as $v) {
print_r($v->getData());
}
$i++;
echo "<br/>";
}
$product = Mage::getModel("catalog/product")->load(1); //product id 1
$i = 1;
echo "<pre>";
foreach ($product->getOptions() as $o) {
echo "<strong>Custom Option:" . $i . "</strong><br/>";
echo "Custom Option TITLE: " . $o->getTitle() . "<br/>"; //Colors
echo "Custom Option TYPE: " . $o->getType() . "<br/>"; //drop_down
echo "Custom Option Values: <br/>";
$values = $o->getValues();
foreach ($values as $v) {
print_r($v->getData());
}
$i++;
echo "<br/>";
}
it works perfect .thanks
ReplyDelete