- $subtotal=$_SESSION['cart'][$row['id_product']]['quantity']*$row['price'];
- $totalprice+=$subtotal;
Vil gerne have et total med moms:
Hvor den smider 25% på samlet beløb. kan man dette?.
<td>Total: <?php echo $totalprice ?> kr.</td>
- <tr>
- <td><?php echo $row['name'] ?></td>
- <td><input type="text" name="quantity[<?php echo $row['id_product'] ?>]" size="5" value="<?php echo $_SESSION['cart'][$row['id_product']]['quantity'] ?>" /></td>
- <td><?php echo $row['price'] ?> kr.</td>
- <td><?php echo $_SESSION['cart'][$row['id_product']]['quantity']*$row['price'] ?> kr.</td>
- </tr>
- <?php
-
- }
- ?>
- <tr>
- <td>Total: <?php echo $totalprice ?> kr.</td>
- </tr>