Let's say $_SESSION['totalprice'] is 1200. However echo $totalprice; outputs 1200 and echo $grandtotal; outputs 66. Grandtotal should be 1265.
Ben burada yanlış ne yapıyorum?
$totalprice = $_SESSION['totalprice'];
$shipping= 65;
if (count($_SESSION['cart'])){
$count = 1;
foreach ($_SESSION['cart'] as $PID => $row){
echo "<p class='padnmgn'><b>". $row['count'] . " " . $row['name'] . " @ " . $row['price']."</b></p><br/>\n";
echo "<input type='hidden' name='item_name_".$count."' value='".$row['name']."'/>\n";
echo "<input type='hidden' name='item_quantity_".$count."' value='".$row['count']."'/>\n";
echo "<input type='hidden' name='item_price_".$count."' value='".$row['price']."'/>\n";
echo "<input type='hidden' name='item_currency_".$count."' value='NOK'/>\n";
echo "<input type='hidden' name='ship_method_name_".$count."' value='Posten'/>\n";
echo "<input type='hidden' name='ship_method_price_".$count."' value='65.00'/>\n";
}
}
$grandtotal = $totalprice + $shipping;
echo $totalprice;
echo $grandtotal;