shopifyextras / php-shopify-api-wrapper Goto Github PK
View Code? Open in Web Editor NEWShopify PHP (Guzzle) API Wrapper
Home Page: http://www.zapiet.com/
License: MIT License
Shopify PHP (Guzzle) API Wrapper
Home Page: http://www.zapiet.com/
License: MIT License
I've successfully added and tested support for guzzle 6.2.1 in my forked repo.
Not sure thought should I make a pull request for it.
Please, do let me know if it's something of your interest.
- shopifyextras/shopify-php-api-wrapper v1.1 requires guzzlehttp/guzzle ~5.0.3 -> satisfiable by guzzlehttp/guzzle[5.0.3] but these conflict with your requirements or minimum-stability.
i need to update product who have size and color options. how to delete variation and add some new variations?
src/resources/order-risk.php, line 24, the URI should be "/admin/orders/{id}/risks.json" (note the plural risks)
Hi
Using your Shopify client; seems like it has a pretty friendly API!
To get it working with a private app, I had to deviate a bit from the instructions
<?php
require 'vendor/autoload.php';
// Shopify::settings gave errors about unknown class Shopify
$client = new Shopify\Client();
$url = "thename.myshopify.com";
$key = "the-password-field-in-the-private-app-auth-section";
// found by looking at the source a bit :)
$client->settings(Array("shopUrl" => $url, "X-Shopify-Access-Token" => $key));
// try it
print_r($client->getProducts());
Seems to work now :)
Thanks!!
Any updates for the upcoming Price Rules endpoint?
how to generate a accessToken,thanks.
getProductCount have no parameters.
how to get http header using PHP-Shopify-APIP-Wrapper?
Error Occur : Error executing command: cURL error 6: Could not resolve host: https
Hi,
I'm trying to instantiate multiple clients; I got it working just fine with 1 client, but if I create 2
$client1 = new Shopify\Client();
...
$client2 = new Shopify\Client();
...
then any call I make with $client2 still uses the shop url from $client1...
Thanks!
I'm unable to load the Client using the Laravel facade. If I change the getFacadeAccessor()
method to return 'Shopify\Client'
instead of 'shopify'
, it works fine though. Isn't the facade supposed to return the Client instead of just 'shopify'
?
Hi,
This message is for those that contribute to this repo regarding embedded apps. Shopify will be migrating from cookies to session tokens, which currently is a requirement for new apps but existing apps have until Jan 1 2022. Just wanted to check if this library would be affected and if any assistance is required.
Thanks
Howdy,
Typo here "getSmartCollectionsCount" => array( "httpMethod" => "GET", "uri" => "/admin/smart_collectoins/count.json"
On the "uri" line it should be "uri" => "/admin/smart_collections/count.json"
.
Also, I noticed for "getSmartCollections" method, that published_status is set to a number type, but in the Shopify API docs this is set as a string. https://docs.shopify.com/api/reference/smartcollection#index
[31-May-2017 09:56:04 Etc/GMT] PHP Fatal error: Uncaught exception 'ShopifyCurlException' with message 'Connection timed out after 30001 milliseconds' in /home/avishopr/public_html/playground/mysqg/M-Sendy/shopify.php:117
Stack trace:
#0 /home/avishopr/public_html/playground/mysqg/M-Sendy/shopify.php(36): ShopifyClient->curlHttpApiRequest('POST', 'https://sellerb...', '', 'client_id=95c6c...', Array)
#1 /home/avishopr/public_html/playground/mysqg/M-Sendy/authorization.php(16): ShopifyClient->getAccessToken('35e185a7821981e...')
#2 {main}
thrown in /home/avishopr/public_html/playground/mysqg/M-Sendy/shopify.php on line 117
Earlier it was working. now its throwing time out error. please let me know, what change need to do
Feature request.
It would be great to add a plugin that understood the Shopify API limits and would intelligently block and/or retry as needed to either avoid exceeding them or retry after exceeding them. Something based on the work in the old Guzzle BackoffPlugin might work.
Hey,
Is it possible to add variants' metafields endpoints?
I'll make a PR, thanks!
HI,
when trying to do give the command to the composer as
composer require shopifyextras/shopify-php-api-wrapper
i am getting the response as below,
Your requirements could not be resolved to an installable set of packages.
Problem 1
- shopifyextras/shopify-php-api-wrapper v1.1 requires guzzlehttp/guzzle ~5.0.3 -> satisfiable by guzzlehttp/guzzle[5.0.3] but these conflict with your requirements or minimum-stability.
- guzzlehttp/command 0.7.0 requires guzzlehttp/guzzle ~5.0 -> satisfiable by guzzlehttp/guzzle[5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.1.0, 5.2.0, 5.3.0, 5.3.1, 5.3.2, 5.3.x-dev] but these conflict with your requirements or minimum-stability.
- shopifyextras/shopify-php-api-wrapper 1.1.1 requires guzzlehttp/guzzle ~5.0.3 -> satisfiable by guzzlehttp/guzzle[5.0.3] but these conflict with your requirements or minimum-stability.
- shopifyextras/shopify-php-api-wrapper 1.1.3 requires guzzlehttp/command 0.7.0 -> satisfiable by guzzlehttp/command[0.7.0].
- Installation request for shopifyextras/shopify-php-api-wrapper ^1.1 -> satisfiable by shopifyextras/shopify-php-api-wrapper[1.1.1, 1.1.3, v1.1].
Installation failed, reverting ./composer.json to its original content.
```
`
any idea how to resolve this issue.?
Hi, can this code be run locally on Windows 10 like a dashboard allowing me to find out the status of my Customers Installed Shopify App Status? Status such as Active, accepted, pending, declined or expired?
Please advise....Thank you!
The uri set in the getProduct method is
"uri" => "/admin/product/{id}.json",
It should be
"uri" => "/admin/products/{id}.json",
Problem 1
- Installation request for guzzlehttp/guzzle (locked at 6.3.0) -> satisfiable by guzzlehttp/guzzle[6.3.0].
- shopifyextras/shopify-php-api-wrapper 1.1.3 requires guzzlehttp/command 0.7.0 -> satisfiable by guzzlehttp/command[0.7.0].
- Conclusion: don't install guzzlehttp/command 0.7.0
- shopifyextras/shopify-php-api-wrapper 1.1.1 requires guzzlehttp/guzzle ~5.0.3 -> satisfiable by guzzlehttp/guzzle[5.0.3].
- shopifyextras/shopify-php-api-wrapper v1.1 requires guzzlehttp/guzzle ~5.0.3 -> satisfiable by guzzlehttp/guzzle[5.0.3].
- Conclusion: don't install guzzlehttp/guzzle 5.0.3
- Installation request for shopifyextras/shopify-php-api-wrapper ^1.1 -> satisfiable by shopifyextras/shopify-php-api-wrapper[1.1.1, 1.1.3, v1.1].
I'm wondering if there was any particular reason that the postField location is used for most create/update methods instead of using json. The json location is used in all of the shopify API examples and I have found two cases where the postField location fails and the json location succeeds.
The two examples that I have come across are attempting to add multiple metafields to a product and when creating multiple images on a product. When attempting to add multiple metafields with postField I get validation errors indicating that various metafield values are missing; if I instead pass only one metafield, not an array of metafields, the single field is processed correctly. Multiple images are simply ignored.
Switching the parameter locations to json in the createProduct service definition resolves the problem. I suspect that the problem is avoided when using JSON because when the server decodes the JSON the difference between arrays and objects is clear, so it can see that a list of objects has been sent, while when decoding post fields it will all come through as arrays.
Add Laravel 8 compatibility to the package.
I have trouble understanding what this does:
https://github.com/ShopifyExtras/PHP-Shopify-API-Wrapper/blob/master/src/Client.php#L139
getEmitter() doesn't exist in V6 but does in V5.
I get this error:
PHP Fatal error: Uncaught InvalidArgumentException: Magic request methods require a URI and optional options array in /var/www/public/api/vendor/guzzlehttp/guzzle/src/Client.php:79
Stack trace:\n#0 /var/www/public/api/src/Client.php(139): GuzzleHttp\\Client->__call('getEmitter', Array)\n#1 /var/www/public/api/src/Client.php(241): Shopify\\Client->buildClient()
#2 /var/www/public/api/index.php(54): Shopify\\Client->__call('getProducts', Array)
#3 {main}\n thrown in /var/www/public/api/vendor/guzzlehttp/guzzle/src/Client.php on line 79
Is there any way to somehow view the methods available to me without having to go through each .php
file inside src/resources/*.php
? Either through somehow dd()
stuff to the view, or using Debugbar, or autocomplete in PhpStorm?
I am trying to delete a metafield using the deleteProductMetafield function and passing (Array ([id] => 8694792272 [metafieldId] => 30289307280)
.
The application returns an error:
Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error response [url] https://<shopUrl>.com/admin/products/8694792272/metafields/8694792272.json [status code] 404 [reason phrase] Not Found '....
It seems like it is passing twice the same id ... ... Am I wrong?
Will you be adding support for discount, gift card and Multipass APIs that come with shopify plus?
Can i create new order by variant sku?
Why no support for this?
Any chance this will be able to use the latest guzzle (v6.2)? Getting conflicts when trying to require dev-master branch with composer. composer.json shows that either v 5 or 6 can be used but guzzlehttp/command 0.7.0 requires guzzle 5
In the library, the endpoint is:
/admin/customers.json
In the doc (https://docs.shopify.com/api/customeraddress#create), it's:
/admin/customers/#{id}/addresses.json
Would it be possible to update the client?
I can submit a pull request if needed.
Thanks,
I can't see where i can get the call limit data...
Is there a way to have Shopify Leaky bucket data?
If not, is there a plan to add the Leaky bucket function support?
Or is there a way, using this library, to get the call limits?
I followed the installation guide except i downloaded it and used "composer install" but i get
Parse error: syntax error, unexpected '$client' (T_VARIABLE) in C:\Users\Matrix\Cloud\OneDrive\WebD\ss\shopify\index.php on line 5
sometimes I can fix this missing var issue by putting "global $var" but in this case it isn't working. I feel pretty nooby considering all it is, is including autoload.php :/ I have done this kind of thing before! I swear! :P
How can I create webhook using PHP-Shopify-API-Wrapper?
Please let me know which setting will be needed for that ?
Does this support making public app?
shopifyextras/shopify-php-api-wrapper 1.1.3 requires guzzlehttp/command 0.7.0 -> satisfiable by guzzlehttp/command[0.7.0].
- shopifyextras/shopify-php-api-wrapper 1.1.3 requires guzzlehttp/command 0.7.0 -> satisfiable by guzzlehttp/command[0.7.0].
- shopifyextras/shopify-php-api-wrapper v1.1.0 requires guzzlehttp/guzzle ~5.0.3 -> satisfiable by guzzlehttp/guzzle[5.0.3] but these conflict with your requirements or minimum-stability.
- shopifyextras/shopify-php-api-wrapper 1.1.1 requires guzzlehttp/guzzle ~5.0.3 -> satisfiable by guzzlehttp/guzzle[5.0.3] but these conflict with your requirements or minimum-stability.
- guzzlehttp/command 0.7.0 requires guzzlehttp/guzzle ~5.0 -> satisfiable by guzzlehttp/guzzle[5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.1.0, 5.2.0, 5.3.0, 5.3.1, 5.3.2, 5.3.x-dev] but these conflict with your requirements or minimum-stability.
- guzzlehttp/command 0.7.0 requires guzzlehttp/guzzle ~5.0 -> satisfiable by guzzlehttp/guzzle[5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.1.0, 5.2.0, 5.3.0, 5.3.1, 5.3.2, 5.3.x-dev] but these conflict with your requirements or minimum-stability.
- Installation request for shopifyextras/shopify-php-api-wrapper ^1.1 -> satisfiable by shopifyextras/shopify-php-api-wrapper[1.1.1, 1.1.3, v1.1.0].
Most of the resources definitions incorrectly specify "uri" instead of "query" for the location of parameters, e.g. the standard "limit" and "page" pagination parameters. "uri" is intended for parameters which form part of the path, not part of the query string, so the end result is that these parameters are not applied. I stumbled across it with the aforementioned pagination parameters, but it looks to be widespread.
I created a custom app form shopify partner account.
Used this as my application https://github.com/phpish/shopify_app-skeleton.git
configured the Callback URL : myapplicationLink/oauth.php
Redirection URl : myapplicationLInk/install.php
Changed my myapplicationLInk/conf.php configuretion based on my app.
So i able to install the app in shopify store with some scope (like 'read_customers', 'read_orders').
Problem : create webhook through PHP api call, as soon as my app is installed in shopify store. (Not able to know how to do ?)
Question : if my problem is resovled can i see the result in ( https://MYSTORE.myshopify.com/admin/webhook.json ) or not once app is installed ??
Sorry for trouble. I very new to shopify API..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.