:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/www/demo/jdc_studio/**
:: Editing File: cart_functions.php
<?php function addToCart($product_id, $name, $price, $image) { if (!isset($_SESSION['cart'])) { $_SESSION['cart'] = []; } // If product already exists → increase qty if (isset($_SESSION['cart'][$product_id])) { $_SESSION['cart'][$product_id]['qty'] += 1; } else { $_SESSION['cart'][$product_id] = [ 'name' => $name, 'price' => $price, 'image' => $image, 'qty' => 1 ]; } } function getCartCount() { if (!isset($_SESSION['cart'])) return 0; $count = 0; foreach ($_SESSION['cart'] as $item) { $count += $item['qty']; } return $count; } function getCartTotal() { if (!isset($_SESSION['cart'])) return 0; $total = 0; foreach ($_SESSION['cart'] as $item) { $total += ($item['price'] * $item['qty']); } return $total; } ?>