Skip to main content

Posts

Showing posts from April, 2014

Showing all category and subcategory in magento

 <select class="select" id="option" value="option" name="option" onchange="short_cat(this.value)"> <option value="*">Select Category</option> <?php $_helper = Mage::helper('catalog/category') ; $_categories = $_helper->getStoreCategories(); $currentCategory = Mage::registry('current_category') ; if (count($_categories) > 0): ?> <?php foreach($_categories as $_category): $selected=''; if($_REQUEST['catid']==$_category->getId()) { $selected='selected'; } ?> <option value="<?php echo $_category->getId() ?>"<?php echo $selected ?>><?php echo $_category->getName() ?></option>             <?php $_category = Mage::getModel('catalog/category')->load($_category->getId()) ?>             <?php $_subcategories =