slince / shopify-api-php

:rocket: Shopify API Client for PHP
MIT License
128 stars 48 forks source link

Search operation with query parameters not working #33

Closed chintankotadia closed 5 years ago

chintankotadia commented 5 years ago

Hello,

Search operation for customer with query parameters always returns all the customers without any filtering.

Following is the example:-

$customer = $client->getCustomerManager()->search(['email:email@example.com']);

Am I missing anything in this one? This is forum post which I am following https://community.shopify.com/c/Shopify-APIs-SDKs/Find-a-Customer-by-Email-via-API-Call/td-p/141661

Thank you!

chintankotadia commented 5 years ago

@slince : I did but same problem. :)

slince commented 5 years ago

hello, this will be fixed in furture version

maximzasorin commented 5 years ago

@chintankotadia

In the search method there is only query parameter, you need to pass a string to it.

Try this:

$customers = $client->getCustomerManager()->search([
    'query' => 'email:address@example.com'
]);
chintankotadia commented 5 years ago

@maximzasorin : Thanks, it did work!

larsjanssen6 commented 4 years ago

Not working for me.