Thursday 20 September 2012

How toGet Percentage of product on Special price in magento

<?php

       $price_f1 = ltrim(  Mage::helper('core')->currency($_product->getPrice(),true,false),'$');
    $price_f2 = trim(    Mage::helper('core')->currency($_product->getspecialPrice(),true,false) ,'$');
      
       $discount_total_p = number_format($price_f1-$price_f2,2);
       $percente_zz= number_format( $discount_total_p/$price_f1*100 ,0);
     $percente_xyz = $percente_zz.'%';
       if($price_f2!='0.00'){
       echo  $percente_xyz ;
     }
    ?>

1 comment:

  1. I like the way you begin and accordingly comprehend your contemplations. Grateful for this unsupportive delicate segments. I truly regard your execute, keep it up
    Outsource magento ecommerce services india | Outsource ecommerce development services

    ReplyDelete

Note: only a member of this blog may post a comment.