I've written this code and echoed everything and everything is coming out right, but the math isn't happening. Can anyone see why?
PHP Code:
$totalbeforequantity = $_SESSION['cart']['content'][$_POST['id']]['sizes'] + $_SESSION['cart']['content'][$_POST['id']]['sizem'] + $_SESSION['cart']['content'][$_POST['id']]['sizel'] + $_SESSION['cart']['content'][$_POST['id']]['sizexl'];
$beforeprice = $totalbeforequantity * $row['price'];
$_SESSION['cart']['total'] -= $beforeprice;
$_SESSION['cart']['content'][$_POST['id']]['sizes'] = $_POST['quantitys'];
$_SESSION['cart']['content'][$_POST['id']]['sizem'] = $_POST['quantitym'];
$_SESSION['cart']['content'][$_POST['id']]['sizel'] = $_POST['quantityl'];
$_SESSION['cart']['content'][$_POST['id']]['sizexl'] = $_POST['quantityxl'];
$totalafterquantity = $_SESSION['cart']['content'][$_POST['id']]['sizes'] + $_SESSION['cart']['content'][$_POST['id']]['sizem'] + $_SESSION['cart']['content'][$_POST['id']]['sizel'] + $_SESSION['cart']['content'][$_POST['id']]['sizexl'];
$afterprice = $totalafterquantity * $row['price'];
$_SESSION['cart']['total'] += $afterprice;