Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Global sale function (Change the order of sale/save placement)

Global sale function (Change the order of sale/save placement)

Started by trademagic on 18 Dec 2013, 7:07 PM · Views: 1,017

Results 1 to 3 of 3
18 Dec 2013, 7:07 PM
#1
trademagic avatar

trademagic

New Zenner

Join Date:
Jul 2013
Location:
Lakewood, California, United States
Posts:
66
Plugin Contributions:
0

Post #1 by trademagic

I could not find a link or any information on this, but think it could be a benefit to all, and would appreciate knowing where to amend the code to make the sale prices appear below the "save 10%" across the whole site, rather than above it. I think it presents more sensibly there. How can I amend the code to make the save 10% appear between the original crossed out price and the adjusted price.

My apologies if this is listed or asked and answered, but it makes so much sense, I have to ask...

Many thanks,

Marc
reasonablerigging.com

Attachment 13561

18 Dec 2013, 8:10 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,154
Plugin Contributions:
56

Post #2 by lat9

It looks like it would be a relatively simple change to (a core file, so make sure that you have a backup) /includes/functions/functions_prices.php's zen_get_products_display_price function. For v1.5.1, this code fragment starts at line 261:

    if ($display_normal_price == 0) {
      // don't show the $0.00
      $final_display_price = $show_special_price . $show_sale_price . $show_sale_discount;
    } else {
      $final_display_price = $show_normal_price . $show_special_price . $show_sale_price . $show_sale_discount;
    }

You'd want to change it to the following (I think) to effect your desired display:

    if ($display_normal_price == 0) {
      // don't show the $0.00
      $final_display_price = $show_special_price . $show_sale_discount . $show_sale_price;  // Swapped sale_discount and sale_price
    } else {
      $final_display_price = $show_normal_price . $show_special_price . $show_sale_discount . $show_sale_price;  // Swapped sale_discount and sale_price
    }
19 Dec 2013, 7:55 AM
#3
trademagic avatar

trademagic

New Zenner

Join Date:
Jul 2013
Location:
Lakewood, California, United States
Posts:
66
Plugin Contributions:
0

Post #3 by trademagic

Brilliant. Bless you! I really think this display is better and makes more sense. Truly, my thanks.