Notifications
Retirer tout
Woo commerce REST API - GET id client
How to WooCommerce
1
Publications
1
Utilisateurs
0
Reactions
3
Vu
Début du sujet
Bonjour,
Comment récupérer dans l'API de Woocommere l'ID du client à partir de son email ?
La réponse est un tableau/array vide !!
$email = urlencode($customers['email']);
$url =' https://xxx.com/wp-json/wc/v2/customers?email='.$email;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$res = curl_exec($ch);
$err = curl_error($ch);
Merci
Posté : 01/04/2020 11:58 pm
Forum Information
- 10 Forums
- 7,342 Sujets
- 22.7 K Publications
- 1 En ligne
- 86.1 K Membres
Notre nouveau membre: ayoluca4291929
Dernière publication: WordPress / WooCommerce - création boutique et restaurant
Icônes du forum:
Le forum ne contient aucun message non lus
Le forum contient des messages non lus
Icônes de sujet:
Pas répondu
Repondu
Actif
Important
Épinglé
Non approuvé
Résolu
Privé
Fermé
