<?php
require_once 'includes/config.php';
session_start();

// Test Adding an item
$_POST['action'] = 'add';
$_POST['id'] = '1';
$_POST['name'] = 'Color Koti';
$_POST['price'] = 150.00;
$_POST['image'] = './assets/images/products/product_1.jpg';
$_POST['quantity'] = 2;

echo "<h3>Testing Add to Cart API...</h3>";
include 'api/cart.php'; 
echo "<br>";

// Test Fetching
$_POST['action'] = 'fetch';
echo "<h3>Testing Fetch Cart API...</h3>";
include 'api/cart.php';
echo "<br>";

// Clean up (optional)
// $pdo->exec("DELETE FROM cart_items WHERE product_id = '1'");
?>
