Skip to main content

Posts

Showing posts from July, 2013

Display Top Level Categories and Current Categories SubCategories

<?php $_helper = Mage::helper( 'catalog/category' ) ?> <?php $_categories = $_helper ->getStoreCategories() ?> <?php $currentCategory = Mage::registry( 'current_category' ) ?> <?php if ( count ( $_categories ) > 0): ?>      <ul>          <?php foreach ( $_categories as $_category ): ?>              <li>                  <a href= "<?php echo $_helper->getCategoryUrl($_category) ?>" >                      <?php echo $_category ->getName() ?>                  </a>                  <?php if ( $currentCategory &amp;&amp; $currentCategory ->getId() == $_category ->getId()): ?>                      <?php $_category = Mage::getModel( 'catalog/category' )->load( $_category ->getId()) ?>                      <?php $_subcategories = $_category ->getChildrenCategories() ?>                      <?php if (

Display Top Level Categories and ALL Subcategories

<?php $_helper = Mage::helper( 'catalog/category' ) ?> <?php $_categories = $_helper ->getStoreCategories() ?> <?php $currentCategory = Mage::registry( 'current_category' ) ?> <?php if ( count ( $_categories ) > 0): ?>      <ul>          <?php foreach ( $_categories as $_category ): ?>              <li>                  <a href= "<?php echo $_helper->getCategoryUrl($_category) ?>" >                      <?php echo $_category ->getName() ?>                  </a>                  <?php $_category = Mage::getModel( 'catalog/category' )->load( $_category ->getId()) ?>                  <?php $_subcategories = $_category ->getChildrenCategories() ?>                  <?php if ( count ( $_subcategories ) > 0): ?>                      <ul>                          <?php foreach ( $_subcategories as $_subc

Display Top Level Categories Only

<?php $_helper = Mage::helper( 'catalog/category' ) ?> <?php $_categories = $_helper ->getStoreCategories() ?> <?php if ( count ( $_categories ) > 0): ?>      <ul>          <?php foreach ( $_categories as $_category ): ?>              <li>                  <a href= "<?php echo $_helper->getCategoryUrl($_category) ?>" >                      <?php echo $_category ->getName() ?>                  </a>              </li>          <?php endforeach ; ?>      </ul> <?php endif ; ?>

How to increase the number of upsell products in magento?

<catalog_product_view translate="label">   <!-- snip -->   <reference name="content">     <!-- snip -->     <block type="catalog/product_list_upsell" name="product.info.upsell"      as="upsell_products" template="catalog/product/list/upsell.phtml">       <action method="setColumnCount">       <columns>       4       </columns>       </action> <action method="setItemLimit">       <type>upsell</type>       <limit>4</limit>       </action> </block>     <!-- snip -->   </reference>   <!-- snip --> </catalog_product_view>

How to remove decimal price in magento

Open  code/core/Mage/Directory/Model/Currency.php  Find the following :-  public  function  format( $price ,  $options = array() ,  $includeContainer  =  true ,  $addBrackets  =   false )     {          return   $this -> formatPrecision( $price , 2,  $options ,  $includeContainer ,  $addBrackets );     } on line no 194 change this code to:-  public  function  format( $price ,  $options = array() ,  $includeContainer  =  true ,  $addBrackets  =   false )     {          return   $this -> formatPrecision( $price , 0,  $options ,  $includeContainer ,  $addBrackets );     }