2

enter image description here

Need get Sub options with id 38, 39 Easy get options $_product->getOptions() but how get sub options (row) ?

Ratio
  • 87
  • 7

3 Answers3

1

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.

Shashank
  • 238
  • 2
  • 8
1

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);
Amit Bera
  • 77,456
  • 20
  • 123
  • 237
0

Resolved

foreach ($_product->getOptions() as $option) {
    $option->getValues()
}
Marius
  • 197,939
  • 53
  • 422
  • 830
Ratio
  • 87
  • 7