<?php require_once __DIR__ . '/../app/bootstrap.php'; $q=trim($_GET['q']??''); $rows=App\Core\Database::fetchAll('SELECT id,name,slug,sku,sale_price,regular_price,stock FROM products WHERE status="published" AND (name LIKE ? OR sku LIKE ?) LIMIT 20',['%'.$q.'%','%'.$q.'%']); App\Core\Response::json(['ok'=>true,'results'=>$rows]);
