PHP:购物车计算失灵

I have a mini shopping cart, Which updates the shopping cart in real time. I have a item count for each time a item has been added into the cart, it adds one to the item count each time a item is added. I have been testing my cart and noticed the cart number count does not match the actual number of item in the cart, for example, if i have add 4 items to the cart, the number count will show as 7.

I realised the number count starts at 3 instead instead of 0, After further investigation i realised that the item count is adding the restaurants id number to the number count, in this case the restaurant_id number is 3.

I have not used the restaurant id to create the number count, which is confusing, i have tried misusing the restaurant id variable from the number count, but the count then starts of at -2 instead of 0.

How can i get my number count to start at 0?

PHP

if (isset($_POST['add'])) {
$_SESSION['Shopping_cart_' . (int) $_GET['add_item']]+='1';
} 
function cart() {
if ($value > 0) {
     $runn_query = mysqli_query($dbc, $get_query);
     mysqli_stmt_execute($runn_query);
     while ....
         $item_sub = $get_row['Product_Price'] * $value;
     .....
        //creating subtotal

        $total += $sub_total ;
        ......

        echo "Items";

What have i tried

  $num_item += $value -=$_SESSION['rest_id']

and

if ($num_items ==0){
        echo "";

    }else{
    echo "$num_items";
    }

Pretty confused at the moment.