|
1 | 1 | # PHP Shopify SDK
|
2 | 2 |
|
3 |
| -[](https://travis-ci.org/phpclassic/php-shopify) [](https://packagist.org/packages/phpclassic/php-shopify) [](https://packagist.org/packages/phpclassic/php-shopify) [](https://packagist.org/packages/phpclassic/php-shopify) [](https://packagist.org/packages/phpclassic/php-shopify) [](https://packagist.org/packages/phpclassic/php-shopify) [](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ME9N6M2B87XT4¤cy_code=USD&source=url) |
| 3 | +[](https://travis-ci.org/phpclassic/php-shopify) [](https://packagist.org/packages/phpclassic/php-shopify) [](https://packagist.org/packages/phpclassic/php-shopify) [](https://packagist.org/packages/phpclassic/php-shopify) [](https://packagist.org/packages/phpclassic/php-shopify) [](https://packagist.org/packages/phpclassic/php-shopify) [](https://www.upwork.com/fl/tareqmahmood?s=1110580755107926016) |
4 | 4 |
|
5 | 5 | PHPShopify is a simple SDK implementation of Shopify API. It helps accessing the API in an object oriented way.
|
6 | 6 |
|
@@ -171,7 +171,7 @@ $shopify->Order($orderID)->put($updateInfo);
|
171 | 171 | ```php
|
172 | 172 | $webHookID = 453487303;
|
173 | 173 |
|
174 |
| -$shopify->Webhook($webHookID)->delete()); |
| 174 | +$shopify->Webhook($webHookID)->delete(); |
175 | 175 | ```
|
176 | 176 |
|
177 | 177 |
|
@@ -255,6 +255,36 @@ Query;
|
255 | 255 |
|
256 | 256 | $data = $shopify->GraphQL->post($graphQL);
|
257 | 257 | ```
|
| 258 | +##### Variables |
| 259 | +If you want to use [GraphQL variables](https://shopify.dev/concepts/graphql/variables), you need to put the variables in an array and give it as the 4th argument of the `post()` method. The 2nd and 3rd arguments don't have any use in GraphQL, but are there to keep similarity with other requests, you can just keep those as `null`. Here is an example: |
| 260 | + |
| 261 | +```php |
| 262 | +$graphQL = <<<Query |
| 263 | +mutation ($input: CustomerInput!) { |
| 264 | + customerCreate(input: $input) |
| 265 | + { |
| 266 | + customer { |
| 267 | + id |
| 268 | + displayName |
| 269 | + } |
| 270 | + userErrors { |
| 271 | + field |
| 272 | + message |
| 273 | + } |
| 274 | + } |
| 275 | +} |
| 276 | +Query; |
| 277 | + |
| 278 | +$variables = [ |
| 279 | + "input" => [ |
| 280 | + "firstName" => "Greg", |
| 281 | + "lastName" => "Variables", |
| 282 | + "email" => "gregvariables@teleworm.us" |
| 283 | + ] |
| 284 | +] |
| 285 | +$shopify->GraphQL->post($graphQL, null, null, $variables); |
| 286 | +``` |
| 287 | + |
258 | 288 |
|
259 | 289 | ##### GraphQL Builder
|
260 | 290 | This SDK only accepts a GraphQL string as input. You can build your GraphQL from [Shopify GraphQL Builder](https://help.shopify.com/en/api/graphql-admin-api/graphiql-builder)
|
@@ -456,10 +486,10 @@ The custom methods are specific to some resources which may not be available for
|
456 | 486 | ## Reference
|
457 | 487 | - [Shopify API Reference](https://help.shopify.com/api/reference/)
|
458 | 488 |
|
459 |
| -## Donation |
460 |
| -If this project help you reduce time to develop, you can donate any amount, which will help us to devote more hours to this project and ensure more frequent updates. |
| 489 | +## Paid Support |
| 490 | +You can hire the author of this SDK for setting up your project with PHPShopify SDK. |
461 | 491 |
|
462 |
| -[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ME9N6M2B87XT4¤cy_code=USD&source=url) |
| 492 | +[Hire at Upwork](https://www.upwork.com/fl/tareqmahmood?s=1110580755107926016) |
463 | 493 |
|
464 | 494 | ## Backers
|
465 | 495 |
|
|
0 commit comments