PHP code example of rothrauff-consulting / shopify

1. Go to this page and download the library: Download rothrauff-consulting/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/ */

    

rothrauff-consulting / shopify example snippets

 php
use RothrauffConsulting\Shopify\Shopify;

$shopify = new Shopify('store_url', 'app_api_key', 'app_password');
 php
use RothrauffConsulting\Shopify\Shopify;

$shopify = new Shopify('store_url', 'app_api_key', 'app_password', 'api_version');
 php
$shopify->get('products');
$shopify->get('products', ['fields' => 'id,title']);

$shopify->post('products', [
    'product' => [
        //new product
    ]
]);

$shopify->put('products/{id}', [
    'product' => [
        //update product
    ]
]);

$shopify->delete('products/{id}');
 php
$shopify->delete('themes/{theme_id}/assets', ['asset[key]' =>  'asset_key']);