Синтаксическая ошибка, неожиданный '$item_count' (T_VARIABLE)
( ! ) Ошибка синтаксического анализа: синтаксическая ошибка, неожиданный '$item_count' (T_VARIABLE) в C:\wamp64\www\all4you\cart.php на линии 53
Что я уже пробовал:
<?php require_once 'dbconnect.php'; include ('pages/header.php'); include ('pages/detals-menu.php'); if ($cart_id!='') { $cartQ=$db->query("SELECT * FROM cart WHERE id='{$cart_id}'"); $result=mysqli_fetch_assoc($cartQ); $items=json_decode($result['items'],true); $i=1; $sub_total=0; $item_count=0; } ?> <div class="col-md-12"> <div class="container"> <div class="row"> <h3 class="text-center">ჩემი კალათა</h3><hr> <?php if ($cart_id==''): ?> <div class="bg-danger"> <p class="text-center text-danger"> კალათა ცარიელია! </p> </div> <?php else: ?> <?php foreach ($items as $item) { $product_id=$item['id']; $productQ=$db->query("SELECT *FROM products WHERE id='{$product_id}'"); $product=mysqli_fetch_assoc($productQ); $sArray=explode(',', $product['sizes']); foreach ($sArray as $sizeString) { $s=explode(':', $sizeString); if ($s[0]==$item['size']) { $available=$s[1]; } } ?> <?php $i++ $item_count+=$item['quantity']; $sub_total+=($product['price'] * $item['quantity']); } $tax=TAXRATE* $sub_total; $tax=number_format($ax,2); $grand_total=$tax+$sub_total; ?> <table class="table table-bordered table-condensed table-striped"><thead><tr><th>#</th><th>პროდუქცია</th><th>ფასი</th><th>რაოდენობა</th><th>ზომა</th><th>ჯამი</th></tr></thead> <tbody><tr> <td><?=$i;?></td> <td><?=$product['title'];?></td> <td><?=money($product['price']);?></td> <td><?=$item['quantity'];?></td> <td><?=$item['size'];?></td> <td><?=money($item['quantity'] * $product['price']);?></td> </tr></tbody> </table> ჯამი <table class="table table-bordered table-condensed text-right"><thead class="totals-table-header"><tr><th>პროდუქციის რაოდენობა</th><th>სულ ჯამში</th><th>tax</th><th>gran total</th></tr></thead> <tbody> <tr> <td><?=$item_count; ?></td> <td><?=money($sub_total); ?></td> <td><?=money($tax); ?></td> <td class="bg-success"><?=money($grand_total); ?></td> </tr> </tbody> </table> <?php endif; ?> </div> </div> </div> <?php include('pages/footer.php'); ?>