1. Go to this page and download the library: Download jeppos/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/ */
jeppos / shopify-php-sdk example snippets
ine\Common\Annotations\AnnotationRegistry::registerLoader('class_exists');
$shopifySDK = new \Jeppos\ShopifySDK\ShopifySDK('your-store-name.myshopify.com', 'api-key', 'api-secret');
// Get a Product class
$product = $shopifySDK->products->getOne(123);
// Display the product title
echo $product->getTitle();
// Get an array of CustomCollection classes
$customCollections = $shopifySDK->customCollections->getList();
// Display the title of each custom collection on a new line
foreach ($customCollections as $customCollection) {
echo $customCollection->getTitle() . PHP_EOL;
}
$product = new Product();
$product->setTitle('My new product');
$shopifySDK->products->createOne($product);
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.