Tuesday 12 April 2016

How to get attribute code in Magento filter.phtml file?

If you want to get attribute code in Magento "filter.phtml" file.



Then use below code in foreach loop: 



<?php echo $_item->getFilter()->getAttributeModel()->getAttributeCode() ?>






How to remove product count from layered navigation in Magento?

If we want to remove product count from layered navigation in Magento, then we can follow following different steps:


1. You can disable the product count in layered navigation from the Admin Panel, without modifying any templates.


               Open Admin Panel and change following setting.



System -> Configuration -> Catalog -> Layered Navigation -> Display Product Count   


Set Display Product Count "No" and save setting.






2. You can remove from phtml file.

      Open following file from following location:

      app/design/frontend/base/default/template/catalog/layer


      And Remove below code or comment code:

     (<?php echo $_item->getCount()  ?>)





Thursday 7 April 2016

How to Remove/ Disable “Estimate Shipping and Tax” from cart page in Magento

If You want to Remove or Disable “Estimate Shipping and Tax” from cart page in Magento.


Then remove following code from: 



/app/design/frontend/your_package/yourtheme/layout/checkout.xml



Locate this piece of code on line 89:



<block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/>






Comment it out using <!–.....................…–> like:






Now, refresh the shopping cart page, you will no longer see the ‘Estimate Shipping and Tax’ block.






Tuesday 5 April 2016

How to display “You Save” option on product detail page in Magento

You want to display "You Save: $ 0000" Price for "Special Price" on product detail page in Magento. Then you can follow the following steps:


Copy following file:

   
 app/design/frontend/base/default/template/catalog/product/price.phtml       
    

to your theme folder:


 app/design/frontend/default/yourtemplate/template/catalog/product/price.phtml


Then


Paste Following code, After 

   <?php   else: /* if ($_finalPrice == $_price): */  ?>




Paste Code:


 <?php   if( $cb_finalPrice  <  $cb_OrgPrice ) :     ?>


    <?php 

$_saveDiscountPercent = 100 - round(($cb_finalPrice / $cb_OrgPrice) * 100);  // if you want to display save                                                                           percentage 


  $_saveDiscountAmount = number_format(($cb_OrgPrice - $cb_finalPrice), 2);  


    ?>
        <p class="cbsave">


            <span class="price-label label">You Save :  </span>


            <span class="price">


                   <strong class="save-discont-amount">


 $<?php echo $_saveDiscountAmount ; ?> 


<?php echo '('.$_saveDiscountPercent .'%)'; 

                                   // if you want to display save percentage  ?>


                    </strong> 


            </span>


        </p>


    <?php endif;  ?>