0pt1cKill3r
New Member
Let's say $_SESSION['totalprice'] is 1200.However echo $totalprice; outputs 1200 and echo $grandtotal; outputs 66. Grandtotal should be 1265. What am I doing wrong here?\[code\]$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='http://stackoverflow.com/questions/1985029/NOK'/>\n"; echo "<input type='hidden' name='ship_method_name_".$count."' value='http://stackoverflow.com/questions/1985029/Posten'/>\n"; echo "<input type='hidden' name='ship_method_price_".$count."' value='http://stackoverflow.com/questions/1985029/65.00'/>\n"; }}$grandtotal = $totalprice + $shipping;echo $totalprice;echo $grandtotal;\[/code\]