How can I get the total to automatically deduct 15%? Here’s the code base:
[php]
<?php echo($_SESSION["title".$counter]); ?> | <?php echo($_SESSION["paymentmethod".$counter]); ?> | $<?php echo($_SESSION["price".$counter]); ?> | <?php echo($_SESSION["qty".$counter]); ?> | $<?php echo($_SESSION["total".$counter]); ?> |
|
Sub Total: | $<?php echo($_SESSION["grandtotal"]); ?> | ||||
- Discount %: | 15 | ||||
Shipping: |
$0 | ||||
Grand Total: | $<?php function add($x,$y) { $total=$x+$y; return $total; } echo add($_SESSION[“grandtotal”],0); |