Showing posts with label View Page. Show all posts
Showing posts with label View Page. Show all posts

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;  ?>