1. Go to this page and download the library: Download signifly/shopify-php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
signifly / shopify-php-sdk example snippets
use Signifly\Shopify\Shopify;
use Signifly\Shopify\Profiles\CredentialsProfile;
$shopify = new Shopify(
new CredentialsProfile(
env('SHOPIFY_API_KEY'),
env('SHOPIFY_PASSWORD'),
env('SHOPIFY_DOMAIN'),
env('SHOPIFY_API_VERSION')
)
);
// Retrieve a list of products
$shopify->products()->all(); // returns a collection of ProductResource
// Count all products
$shopify->products()->count();
// Find a product
$resource = $shopify->products()->find($id); // returns a ProductResource
// Update a product
$shopify->products()->update($id, $data); // returns a ProductResource
// Delete a product
$shopify->products()->destroy($id);
$shopify->products()->all([
'page' => 1,
'limit' => 250,
]);
// returns a collection of ProductResource
$shopify->products()->count(); // returns an integer
$shopify->products()->find(123456789); // returns a ProductResource