Magento display drop down in layer navigation

Default magento does not show the drop down in layer navigation. you need to code for this functionality. Please follow the below step to achieve the display drop down in layer navigation.


Go to this file path 
/app/design/frontend/default/YOUR-THEME/template/catalog/layer/filter.phtml

if you could not find the file from this path , than copy file 
from Base directory to your local theme.
/app/design/frontend/base/default/template/catalog/layer/filter.phtml


Paste below code to filter.phtml file

<select onchange="setLocation(this.value)">
<option value=""><?php echo 'Choose an Option...' ?></option>
<?php foreach ($this->getItems() as $_item): ?>
<?php if ($_item->getCount() > 0): ?>
<option value="<?php echo $this->urlEscape($_item->getUrl()) ?>">
<?php echo $_item->getLabel() ?>
<?php else: echo '->' . $_item->getLabel() ?>
<?php endif; ?>
(<?php echo $_item->getCount() ?>)
</option>
<?php endforeach ?>
</select>

magento programmatically create product with custom options

We can easily Create custom product with custom options in magento.

First we need to create a custom file in magento root directory.
In this code I am create product.php file in root directory and paste below code.

require_once 'app/Mage.php';
umask(0);
$app = Mage::app();
//$session = Mage::getSingleton('customer/session', array('name'=>'frontend'));

//create a new product
try {

$imageurl = Mage::getBaseDir('media').'/your_img_name.jpg';
$product = Mage::getModel('catalog/product');
$stockData = $product->getStockData();
$stockData['qty'] = 10;
$stockData['is_in_stock'] = 1;
$stockData['manage_stock'] = 1;
$stockData['use_config_manage_stock'] = 0;
$options = array();
$options = array(
'title' => 'Option Title’,
'type’ => 'radio’,
'is_require’ => 1,
'sort_order’ => 0,
'values’ => array()
);
$options['values’][] = array(
'title’ => 'Option Value 1′,
'price’ => 0.00,
'price_type’ => 'fixed’,
'sku’ => '',
'sort_order’ => '1’
);
$options['values’][] = array(
'title’ => 'Option Value 2′,
'price’ => 89.00,
'price_type’ => 'fixed’,
'sku’ => '',
'sort_order’ => '1’
);

$product->setStoreId('default’)
->setTypeId('simple’)
->setAttributeSetId(4)
->setName('GTSProducts’)
->setDescription(“Gts magento test description”)
->setShortDescription(“Gts magento test short description”)
->setSku('gts')
->setWeight(1.0)
->setStatus(1)
->setVisibility(4)
->setPrice(19)
->addImageToMediaGallery($imageurl ,array('thumbnail’,’small_image’,’image’)
,true,false)
->setTaxClassId(0)
->setStockData($stockData)
->setCategoryIds('3′)
->setHasOptions(1)
->setProductOptions(array($options))
->setCanSaveCustomOptions(true)
->save();

echo 'OK Product ID: '.$product->getId();

$cache = Mage::getSingleton('core/cache’);
$cache->flush();
}
catch (Mage_Core_Exception $e) {
echo $e->getMessage();
}
catch (Exception $e) {
echo $e;
}

To know more about magento directory path here

Magento add programatically Product image or addImageToMediaGallery