%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64 User : ndkhermy ( 1200) PHP Version : 8.5.12 Disable Function : NONE Directory : /home1/ndkhermy/public_html/website_93b53270/ |
Upload File : |
<?php
session_start();
if (isset($_POST['product_id'])) {
$productIdToRemove = $_POST['product_id'];
if (isset($_SESSION['cart'][$productIdToRemove])) {
// Remove the product from the cart
unset($_SESSION['cart'][$productIdToRemove]);
$response = array('status' => 'success', 'message' => 'Product removed from the cart');
} else {
$response = array('status' => 'error', 'message' => 'Product not found in the cart');
}
echo json_encode($response);
} else {
$response = array('status' => 'error', 'message' => 'Invalid request');
echo json_encode($response);
}
?>