0

I am working on magento 1.7 version. I added some custom options in the products from admin. Now they are showing on product detail page.But I just want to show on another page. I mean I have a button on product detail page when i clicked on that button these custom options should be display and after fill that form it should be redirect to add to cart page. I am using code as below:-

$product_id = $_REQUEST['id1'];
$product = Mage::getModel("catalog/product")->load($product_id);
$attVal = $product->getOptions();
foreach($attVal as $optionKey => $optionVal) {
$optStr .= "<select style='display:block; clear:both;' name='options[".$optionVal->getId()."]'>";
foreach($optionVal->getValues() as $valuesKey => $valuesVal) {
$optStr .= "<option value='".$valuesVal->getId()."'>".$valuesVal->getTitle()."</option>";
}
$optStr .= "</select>";
}
echo($optStr );

I am doing this process on a index.phtml in app\design\frontend\base\default\template\form.which i created using module creator. I am getting getting value of $product_id.But when I do print_r($attVal) it only shows array() on frontend.

Mukus
  • 4,870
  • 2
  • 43
  • 56
Neeraj
  • 101
  • 5
  • 16
  • I think this issue is allready answered (see answer 3) http://stackoverflow.com/questions/2829164/how-to-get-custom-options-programmatically-in-magento – ShopWorks Nov 29 '12 at 12:49
  • that was not working for me.Can you suggest me any extention for this? – Neeraj Nov 30 '12 at 04:44

0 Answers0