Hi All
How do I add shipping_costs to view_cart.php. It's getting more complicated the more I think about real life situations because shipping costs is determined by weight.
The column 'shipping_cost' already added to database, so do I plus (+) the shipping cost to quantity, or times (x) shipping cost by quantity? Can someone show me both ways as it probably depends on the situation in real life.
Here's the view_cart.php section that needs the extra code:
// Calculate the total and sub-totals.
$subtotal = $_SESSION['cart'][$row['print_id']]['quantity'] * $_SESSION['cart'][$row['print_id']]['price'];
$total += $subtotal;
// Print the row:
echo "\t<tr>
<td align=\"left\">{$row['artist']}</td>
<td align=\"left\">{$row['print_name']}</td>
<td align=\"right\">£{$_SESSION['cart'][$row['print_id']]['price']}</td>
<td align=\"center\"><input type=\"text\" size=\"3\" name=\"qty[{$row['print_id']}]\" value=\"{$_SESSION['cart'][$row['print_id']]['quantity']['shipping_cost']}\" /></td>
<td align=\"right\">£" . number_format ($subtotal, 2) . "</td>
</tr>\n";