Tuesday, 18 June 2013

Show brands in magento


<?php
$manufacturers = $this->getAllBrands();
?>


<?php /*?><h4><?php echo $this->__('Brands')?></h4><?php */?>
 <select class="brand" id="select1" onchange="goToPage('select1')">
<option selected="selected">Brand</option>
<?php foreach($manufacturers as $k=>$v): ?>
<option value="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) ?>shopbybrand?brand=<?php echo $v['value']?>" <?php if($_REQUEST['brand']==$v['value']) { ?> selected="selected" <?php } ?> ><?php echo $v['label']?></option>
<?php endforeach; ?>
</select>

<script>
  function goToPage( id ) {
var node = document.getElementById( id );
 window.location.href = node.options[node.selectedIndex].value;
}
</script>

No comments:

Post a Comment