Need get Sub options with id 38, 39 Easy get options $_product->getOptions() but how get sub options (row) ?
-
are want the data using options select field 38,39?– Amit Bera ♦Commented Feb 11, 2015 at 12:28
-
yes.., but how?– RatioCommented Feb 11, 2015 at 12:31
-
$productOptionValue = Mage::getModel('catalog/product_option_value')->load($valueId);– Amit Bera ♦Commented Feb 11, 2015 at 12:37
-
are you want all value of option Select your service using it id?– Amit Bera ♦Commented Feb 11, 2015 at 12:56
3 Answers
To get Data of Options That is Select your Service
in your case
you can do like this
$products = Mage::getModel('catalog/product')->load('1');
//product Id with custom options
$option = Mage::getModel('catalog/product_option')->getProductOptionCollection($product);
foreach($option as $o){
print_r($o->getData());
}
and to get value Data that is Row 38 and 39 in your case do it like this
$products = Mage::getModel('catalog/product')->load('1');
//product Id with custom options
$option = Mage::getModel('catalog/product_option')->getProductOptionCollection($product);
foreach ($option as $o) {
print_r($o->getData());
$values = Mage::getSingleton('catalog/product_option_value')->getValuesCollection($o);
foreach($values as $value){
print_r($value->getData());
}
}
and you will have it all.
You ca get the details by Mage::getModel('catalog/product_option_value') Please use this
$productOptionValue = Mage::getModel('catalog/product_option_value')->load($valueId);
$valueId=38;
Also for getting option value using option id,use
$collection = Mage::getResourceModel('catalog/product_option_value_collection')
->addFieldToFilter('option_id', $optionId)
->getValues($CurrentStoreId);
get Value ids by Option
$collection = Mage::getResourceModel('catalog/product_option_value_collection')
->addFieldToFilter('option_id', $option_id)
->getValuesByOption($optionIds, $store_id);