Quote Originally Posted by iZilla_Pod View Post
I messed around with the code for awhile. Hopefully this will help someone.

Heres the original piece of code for the contribution you will be replacing:
PHP Code:
    if ($display_normal_price == 0) {
      
// don't show the $0.00
      
if(($display_msrp_price!='')&&($display_msrp_price!='0')){
      
$save=$display_msrp_price-$display_normal_price;
          
$final_display_price '<span class="smalltext1">' TEXT_PRODUCT_MSRP '<s>' $currencies->display_price($display_msrp_pricezen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</s></span><br><span class="save">' TEXT_PRODUCT_SAVE .$currencies->display_price($save'') . '&nbsp;&nbsp;('number_format((($display_msrp_price -  $display_normal_price) / $display_msrp_price), 2'.''') * 100 '%)' '</span><br><span class="norm">' TEXT_PRODUCT_OUR.$show_special_price $show_sale_price $show_sale_discount.'</span>' ;
      }else{
          
$final_display_price $show_special_price $show_sale_price $show_sale_discount;
      }
    } else {
     if((
$display_msrp_price!='')&&($display_msrp_price!='0')){
     
$save=$display_msrp_price-$display_normal_price;
          
$final_display_price '<span class="smalltext1">'.TEXT_PRODUCT_MSRP.'<s>'.$currencies->display_price($display_msrp_pricezen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</s></span><br><span class="save">'.TEXT_PRODUCT_SAVE .$currencies->display_price($save'').'&nbsp;&nbsp;('number_format((($display_msrp_price -  $display_normal_price) / $display_msrp_price), 2'.''') * 100 '%)'.'</span><br><span class="norm">'.TEXT_PRODUCT_OUR.$show_normal_price $show_special_price $show_sale_price $show_sale_discount.'</span>' ;
      }else{
          
$final_display_price $show_normal_price $show_special_price $show_sale_price $show_sale_discount;
      }
    } 
This will show the "You Save" with dollar amount only:
PHP Code:
    if ($display_normal_price == 0) {
      
// don't show the $0.00
      
if(($display_msrp_price!='')&&($display_msrp_price!='0')){
      
$save=$display_msrp_price-$display_normal_price;
          
$final_display_price '<span class="smalltext1">' TEXT_PRODUCT_MSRP '<s>' $currencies->display_price($display_msrp_pricezen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</s></span><br><span class="save">' TEXT_PRODUCT_SAVE $currencies->display_price($save'') . '</span><br><span class="norm">' TEXT_PRODUCT_OUR.$show_special_price $show_sale_price $show_sale_discount.'</span>' ;
      }else{
          
$final_display_price $show_special_price $show_sale_price $show_sale_discount;
      }
    } else {
     if((
$display_msrp_price!='')&&($display_msrp_price!='0')){
     
$save=$display_msrp_price-$display_normal_price;
          
$final_display_price '<span class="smalltext1">'.TEXT_PRODUCT_MSRP.'<s>'.$currencies->display_price($display_msrp_pricezen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</s></span><br><span class="save">'.TEXT_PRODUCT_SAVE $currencies->display_price($save'') . '</span><br><span class="norm">'.TEXT_PRODUCT_OUR.$show_normal_price $show_special_price $show_sale_price $show_sale_discount.'</span>' ;
      }else{
          
$final_display_price $show_normal_price $show_special_price $show_sale_price $show_sale_discount;
      }
    } 
This will show the "You Save" as a percentage only:
PHP Code:
    if ($display_normal_price == 0) {
      
// don't show the $0.00
      
if(($display_msrp_price!='')&&($display_msrp_price!='0')){
      
$save=$display_msrp_price-$display_normal_price;
          
$final_display_price '<span class="smalltext1">' TEXT_PRODUCT_MSRP '<s>' $currencies->display_price($display_msrp_pricezen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</s></span><br><span class="save">' TEXT_PRODUCT_SAVE number_format((($display_msrp_price -  $display_normal_price)), 2'.''') . '%' '</span><br><span class="norm">' TEXT_PRODUCT_OUR.$show_special_price $show_sale_price $show_sale_discount.'</span>' ;
      }else{
          
$final_display_price $show_special_price $show_sale_price $show_sale_discount;
      }
    } else {
     if((
$display_msrp_price!='')&&($display_msrp_price!='0')){
     
$save=$display_msrp_price-$display_normal_price;
          
$final_display_price '<span class="smalltext1">'.TEXT_PRODUCT_MSRP.'<s>'.$currencies->display_price($display_msrp_pricezen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</s></span><br><span class="save">'.TEXT_PRODUCT_SAVE number_format((($display_msrp_price -  $display_normal_price)), 2'.''') . '%' '</span><br><span class="norm">'.TEXT_PRODUCT_OUR.$show_normal_price $show_special_price $show_sale_price $show_sale_discount.'</span>' ;
      }else{
          
$final_display_price $show_normal_price $show_special_price $show_sale_price $show_sale_discount;
      }
    } 
This will remove the "You Save" line completely:
PHP Code:
    if ($display_normal_price == 0) {
      
// don't show the $0.00
      
if(($display_msrp_price!='')&&($display_msrp_price!='0')){
      
$save=$display_msrp_price-$display_normal_price;
          
$final_display_price '<span class="smalltext1">' TEXT_PRODUCT_MSRP '<s>' $currencies->display_price($display_msrp_pricezen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</s></span><br />' '<span class="norm">' TEXT_PRODUCT_OUR.$show_special_price $show_sale_price $show_sale_discount.'</span>' ;
      }else{
          
$final_display_price $show_special_price $show_sale_price $show_sale_discount;
      }
    } else {
     if((
$display_msrp_price!='')&&($display_msrp_price!='0')){
     
$save=$display_msrp_price-$display_normal_price;
          
$final_display_price '<span class="smalltext1">'.TEXT_PRODUCT_MSRP.'<s>'.$currencies->display_price($display_msrp_pricezen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</s></span><br />' '<span class="norm">'.TEXT_PRODUCT_OUR.$show_normal_price $show_special_price $show_sale_price $show_sale_discount.'</span>' ;
      }else{
          
$final_display_price $show_normal_price $show_special_price $show_sale_price $show_sale_discount;
      }
    } 
I'm also looking at moving the "You Save" line below the "MSRP Price" and "Our Price" so that it's in a more logical order. I need to get some rest right now though.


Thanks for sharing that info but i am not sure if you notice that the percent is the dollar amount saved in percent, for example if your saving 500.00 is will look like this 500% and the value is not the true percent of saving. To get the true percent all you have to is remove this section of the code

.$currencies->display_price($save, '')

In both lines as you shown

it should then look like this

.'&nbsp;&nbsp;('. number_format((($display_msrp_price - $display_normal_price) / $display_msrp_price), 2, '.', '') * 100 . '%)'.'</span><br><span class="norm">'.TEXT_PRODUCT_OUR.$show_special_price . $show_sale_price . $show_sale_discount.'</span>' ;

You can view it in action at www.lextechs.com