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

Discount

Started by nick1973 on 12 Mar 2020, 2:28 PM · Views: 2,896

Results 1 to 3 of 3
12 Mar 2020, 2:28 PM
#1
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Post #1 by nick1973

[Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]

When I have sales/discounts set up it displays as SOLD AT: 90.0%

I need it to show the percentage SOLD AT: 10.0%

So the 10% is the difference between 90% and 100%

Which file do I edit to do this

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk

12 Mar 2020, 3:14 PM
#2
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Post #2 by nick1973

Basically I need the output to te the opposite way around. So I need it to show 10% instead of 90%

I have looked in functions_prices.php and could now see how to do this.

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk

13 Mar 2020, 3:28 AM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #3 by mc12345678

Are you using the sale to sell the item at 90% of the original price or to purchase at 10% of the original price?

The default operation is for the percent off to be provided such that if the item is being sold at 90% of the original value (a sale of 10%) then the result is to display 10% off. Further, that would mean that if the sale % off was entered as 90% then the display would be 90% off as the product would be offered at 10% of the price.

One place/example of how to reverse the normal operation (which seems unusual to be an issue) is to modify:

$show_discount_amount = number_format(100 - (($display_sale_price / $display_normal_price) * 100),SHOW_SALE_DISCOUNT_DECIMALS);

To be:

$show_discount_amount = number_format(/*100 - */(($display_sale_price / $display_normal_price) * 100),SHOW_SALE_DISCOUNT_DECIMALS);

So in this one case (there are similar others within the file) if the normal price is say 100 and as a result of placing the sale price to 90% discount off of the base price, then the sale price would be 10, which in the revision would result in reporting: 10/100 * 100 which would provide 10% as the reported value.
Previously it would report 90% as a result of the sold at price being 10 and the normal price being 100 that the result would be a 90% difference as calculated by: 100 - 10/100*100 = 100 - 10 = 90...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...