Fix Shopify API connection on local Windows dev server

Add SSL_VERIFYPEER option to cURL to fix HTTP 0 errors when running
with PHP built-in server on Windows.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
antonin gallon 2026-01-20 12:03:06 +01:00
parent f3f302513e
commit 9396ae4e02

View file

@ -43,6 +43,7 @@ function fetchShopifyProducts(): array
$ch = curl_init($endpoint); $ch = curl_init($endpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Nécessaire pour dev local sur Windows
curl_setopt($ch, CURLOPT_HTTPHEADER, [ curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json', 'Content-Type: application/json',
'X-Shopify-Storefront-Access-Token: ' . $token 'X-Shopify-Storefront-Access-Token: ' . $token