I am trying to get product details including product custom options value in a custom block i created.This is the code i used on product detail page and it worked there, but when trying to use it on custom block page get Options returns empty value.
if ($_product->getId()) { foreach ($_product->getOptions() as $opt) { echo $optionType = $opt->getType(); if ($optionType == 'drop_down') { $values = $opt->getValues(); foreach($values as $v) { $mydata = $v->getTitle(); print_r($mydata); } } } }
I am new to magento so not sure what i am missing out here.
Can any one give me a hint please
Thanks