Custom options are a good solution if your inventory needs are simple and you have a limited number of available SKUs.
[php]
$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/>";
}
[/php]
Hope It helps.
Happy coding
great job!
ReplyDeleteGlad it helpd :-)
ReplyDeletehi... in which file should add this code
ReplyDeleteam new to magento... so please guide me like above code in which file and where have to add...
ReplyDeleteThanks
For practice you can put a file in the root folder use this code :
ReplyDeleterequire_once('app/Mage.php');
Mage::default('admin');
//put the posted code here save and place this file on the root
thanks!!! really good job!
ReplyDeletenice really working thanks for this post this is really helpfull
ReplyDelete