Some time we need to display custom option of product on category list page
to achive this task we only need to paste the code given below in your list.phtml file
$productSku = $_product->getSku();
$product = Mage::getModel('catalog/product');
$productId = $product->getIdBySku( $productSku );
$product = Mage::getModel("catalog/product")->load($productId);
$attVal = $product->getOptions();
$optStr = "";
// loop through the options
foreach($attVal as $optionKey => $optionVal) {
//$optStr .= "<br/>";
//$optStr .= $optionVal->getTitle().": ";
$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 );
Tags: Magento, Magento snippets
I need to get the prices to also display and a code that will add all the prices list getTotalOptionsPrice