% Discount of total

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: % Discount of total

Post by seandisanti » Thu Mar 07, 2013 12:17 pm

Code: Select all

$total*=.85;

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: % Discount of total

Post by seandisanti » Fri Mar 08, 2013 10:32 am

Just assign to a new variable like...

Code: Select all

$reducedTotal = $total * .85;
 
and then you can drop it into your html wherever you want by putting:

Code: Select all

<?php echo $reducedTotal; ?>
play around with it a little bit and you'll get it.

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: % Discount of total

Post by seandisanti » Mon Mar 11, 2013 7:25 am

very close; you're assigning the reduced total to $reducedTotal, not $_SESSION['reducedTotal'] change either of those to be the same as the other and you should be all set.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest