PHP code example of improck / shopify-sdk-php

1. Go to this page and download the library: Download improck/shopify-sdk-php 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/ */

    

improck / shopify-sdk-php example snippets


\Improck\Shopify\Shopify::generateInstallUrl($myshopifyDomain, $apiKey, $scopes, $redirectUrl)

$shopify = new \Improck\Shopify\Shopify($myshopifyDomain, $accessToken);

$shopify = \Improck\Shopify\Shopify::authorize($myshopifyDomain, $code, $apiKey, $secretKey);

$products = $shopify->get("products.json");

echo $products->count();

$products->each(function($product) {
    
    echo $product['title'];
    
});

$firstProduct = $products->first();

$result = $shopify->post("webhooks.json", ["webhook" => []]);

$result = $shopify->put("webhooks/4759306.json", ["webhook" => []]]);

$deletedStatus = $shopify->delete("products/5616516.json");
shell
composer