1. Go to this page and download the library: Download roemerb/php-shopify 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/ */
//your_authorize_url.php
$scopes = 'read_products,write_products,read_script_tags,write_script_tags';
//This is also valid
//$scopes = array('read_products','write_products','read_script_tags', 'write_script_tags');
$redirectUrl = 'https://yourappurl.com/your_redirect_url.php';
\PHPShopify\AuthHelper::createAuthRequest($scopes, $redirectUrl);
//your_redirect_url.php
PHPShopify\ShopifySDK::config($config);
$accessToken = \PHPShopify\AuthHelper::getAccessToken();
//Now store it in database or somewhere else
//your_authorize_and_redirect_url.php
PHPShopify\ShopifySDK::config($config);
$accessToken = \PHPShopify\AuthHelper::createAuthRequest($scopes);
//Now store it in database or somewhere else
$blogID = 23564666666;
$articleID = 125336666;
$updateArtilceInfo = array(
"title" => "My new Title",
"author" => "Your name",
"tags" => "Tags, Will Be, Updated",
"body_html" => "<p>Look, I can even update through a web service.<\/p>",
);
$shopify->Blog($blogID)->Article($articleID)->put($updateArtilceInfo);