├── README.md ├── composer.json ├── conf.php ├── create_product.php ├── get_products.php ├── get_shop.php └── index.html /README.md: -------------------------------------------------------------------------------- 1 | 1. Clone the repo and get dependencies via composer 2 | 3 | ``` 4 | git clone --depth 1 --branch master https://github.com/phpish/shopify_private_app-skeleton.git new_prj 5 | cd new_prj 6 | rm -rf .git 7 | rm README.md 8 | curl -sS https://getcomposer.org/installer | php 9 | php composer.phar install 10 | ``` 11 | 12 | 2. [Create a private app](http://docs.shopify.com/api/authentication/creating-a-private-app). 13 | 3. Update conf.php with the private app's credentials. 14 | 4. Check out the .php files and see how they work. (e.g., http://path-to-new_prj/get_shop.php) -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "minimum-stability": "dev", 3 | "require": { 4 | "php": ">=5.3.0", 5 | "phpish/shopify": "dev-master" 6 | } 7 | } -------------------------------------------------------------------------------- /conf.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /create_product.php: -------------------------------------------------------------------------------- 1 | array 18 | ( 19 | "title" => "Burton Custom Freestlye 151", 20 | "body_html" => "Good snowboard!", 21 | "vendor" => "Burton", 22 | "product_type" => "Snowboard", 23 | "variants" => array 24 | ( 25 | array 26 | ( 27 | "option1" => "First", 28 | "price" => "10.00", 29 | "sku" => 123, 30 | ), 31 | array ( 32 | "option1" => "Second", 33 | "price" => "20.00", 34 | "sku" => "123" 35 | ) 36 | ) 37 | ) 38 | )); 39 | 40 | print_r($product); 41 | } 42 | catch (shopify\ApiException $e) 43 | { 44 | # HTTP status code was >= 400 or response contained the key 'errors' 45 | echo $e; 46 | print_R($e->getRequest()); 47 | print_R($e->getResponse()); 48 | } 49 | catch (shopify\CurlException $e) 50 | { 51 | # cURL error 52 | echo $e; 53 | print_R($e->getRequest()); 54 | print_R($e->getResponse()); 55 | } 56 | 57 | ?> -------------------------------------------------------------------------------- /get_products.php: -------------------------------------------------------------------------------- 1 | 'published')); 16 | print_r($products); 17 | } 18 | catch (shopify\ApiException $e) 19 | { 20 | # HTTP status code was >= 400 or response contained the key 'errors' 21 | echo $e; 22 | print_R($e->getRequest()); 23 | print_R($e->getResponse()); 24 | } 25 | catch (shopify\CurlException $e) 26 | { 27 | # cURL error 28 | echo $e; 29 | print_R($e->getRequest()); 30 | print_R($e->getResponse()); 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /get_shop.php: -------------------------------------------------------------------------------- 1 | = 400 or response contained the key 'errors' 21 | echo $e; 22 | print_R($e->getRequest()); 23 | print_R($e->getResponse()); 24 | } 25 | catch (shopify\CurlException $e) 26 | { 27 | # cURL error 28 | echo $e; 29 | print_R($e->getRequest()); 30 | print_R($e->getResponse()); 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpish/shopify_private_app-skeleton/e675e3c4476dc6934883936ece241b0d0cffd47a/index.html --------------------------------------------------------------------------------