If this is your first visit, check our documentation. To post, register or login.

MSRP Add-on

Started by mortalwombat on 20 Aug 2012, 12:12 PM · Views: 922

Results 1 to 2 of 2
20 Aug 2012, 12:12 PM
#1
mortalwombat avatar

mortalwombat

Zen Follower

Join Date:
Jul 2010
Location:
Australia
Posts:
131
Plugin Contributions:
0

MSRP Add-on

Hello

I have recently installed the add-on 'MSRP Display' and have been trying to tweak it a little... Here's what I want to do:

I'm looking to get the 'You save' section to show the total saving, including any sales or specials, if any, rather than only the difference between MSRP and price.

e.g.
MSRP: $50
Our price: $45
Special: $40
Sale: $35
You save: $5

The 'You save' should read $15.

This is what I have so far (the coding is still a bit messy):

    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 = 'RRP: <span class="smalltext1"><s>'.TEXT_PRODUCT_MSRP.$currencies->display_price($display_msrp_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</s></span><br><span class="save">'.TEXT_PRODUCT_SAVE .$currencies->display_price($save, zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</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')){
    if ($display_special_price) {
     $save=$display_msrp_price-$display_special_price;
          $final_display_price = 'RRP: <span class="smalltext1"><s>'.TEXT_PRODUCT_MSRP.$currencies->display_price($display_msrp_price, zen_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 .'</span><br><span class="save">'.TEXT_PRODUCT_SAVE .$currencies->display_price($save, zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</span>' ;
    } elseif ($display_sale_price) {
     $save=$display_msrp_price-$display_sale_price;
          $final_display_price = 'RRP: <span class="smalltext1"><s>'.TEXT_PRODUCT_MSRP.$currencies->display_price($display_msrp_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</s></span><br><span class="save">'.TEXT_PRODUCT_SAVE .$currencies->display_price($save, zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</span><br><span class="norm">'.TEXT_PRODUCT_OUR.$show_normal_price . $show_special_price . $show_sale_price . $show_sale_discount.'</span>' ;
    } elseif ($display_normal_price) {
     $save=$display_msrp_price-$display_normal_price;
          $final_display_price = 'RRP: <span class="smalltext1"><s>'.TEXT_PRODUCT_MSRP.$currencies->display_price($display_msrp_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</s></span><br><span class="save">'.TEXT_PRODUCT_SAVE .$currencies->display_price($save, zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</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 almost works -- the 'You save' shows the correct amount, including any sales or specials (as in example above). The only problem I have (which, I might add, is pretty serious) is that all other prices without MSRP are missing. They're blank -- they are reading no pricing at all. Those with attributes show the 'Starting at' wording, but nothing else.

I would greatly appreciate any help on this matter... I've been at it for many days now and haven't proceeded.

Thanks in advance,
Tija

23 Aug 2012, 12:11 AM
#2
mortalwombat avatar

mortalwombat

Zen Follower

Join Date:
Jul 2010
Location:
Australia
Posts:
131
Plugin Contributions:
0

Re: MSRP Add-on

Anyone have any ideas?

Still haven't managed to work this out... I'm hoping that the problem is just my bad coding knowledge.

  • Tija