<?php
require_once '../config.php';
require_once '../../includes/Shop.php';

$shop_id = $_GET['shop_id'] ?? null;

if (!$shop_id) {
    jsonResponse(['success' => false, 'message' => 'Shop ID required'], 400);
}

$shop = new Shop();

try {
    $products = $shop->getShopProducts($shop_id);
    
    jsonResponse([
        'success' => true,
        'products' => $products
    ]);
} catch (Exception $e) {
    jsonResponse([
        'success' => false,
        'message' => $e->getMessage()
    ], 500);
}
?>