...

View Full Version : [Help] ----------- Taking a % off a price ---------



Vernk
06-25-2012, 04:13 AM
Hello Coding Forums,

I need help. I have made a coupon code system which will take of the designated amount off their purchase.



if ($_POST['coupon'] == $coupon) {
$percent_off = 15;
$price = $price //math here to get 15% off of the price
}


How would I do this?

Regards,
Vern

Fou-Lu
06-25-2012, 05:42 AM
Trivial mathematics.


$price *= (100 - $percent_off) / 100;


I could absolutely swear we've answered this question for you already.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum