$shipping = 0 ; foreach cart_item { if ($customer_zone == "US" || $customer_zone == "CA"){ if ($products_id == 44) $shipping += 40.00 ; if ($products_id == 45) $shipping += 45.00 ; } else { if ($customer_zone == "ITALY"){ if ($products_id == 44) $shipping += 15.00 ; if ($products_id == 45) $shipping += 16.00 ; } else { // all the other world if ($products_id == 44) $shipping += 80.00 ; if ($products_id == 45) $shipping += 95.00 ; } } }