<?php
session_start();

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // Clear the entire cart
    unset($_SESSION['cartz']);

    // Send a success response
    echo json_encode(['success' => true, 'message' => 'Cart cleared successfully']);
} else {
    // Send an error response for invalid requests
    echo json_encode(['success' => false, 'message' => 'Invalid request']);
}
?>
