shopify/shopify-php

This package is abandoned and no longer maintained. The author suggests using the slince/shopify-api-php package instead.
There is no license information available for the latest version (v0.11) of this package.

PHP library for the Shopify API

v0.11 2017-08-21 18:04 UTC

This package is not auto-updated.

Last update: 2019-02-20 19:41:33 UTC


README

Build Status codecov

Getting started

<?php
require 'vendor/autoload.php'; 

use Shopify\ShopifyClient;

$client = new ShopifyClient($access_token, "yourshop.myshopify.com");
$products = $client->products->readList();

Creating orders

$newOrder = ['line_items' => [['title' => 'cool', 'price' => 4]]];
$response = $client->orders->create($newOrder);

Reading orders

$response = $client->orders->read($orderId);
$object = $response->parsedResponse();
$orders = $client->orders->readList();
foreach ($order in $orders->parsedResponse()) {
    var_dump($order->id);
}

Updating orders

$response = $client->orders->update($orderId, ["note" => "cool order"]);

Counting open orders

$response = $client->orders->readCount(["status" => "open"]);

Deleting orders

$response = $client->orders->delete($orderId);

Testing phpunit

phpunit

Running PHP CodeSniffer

./vendor/bin/phpcs ./src/ --standard=PSR2
./vendor/bin/phpcs ./test/ --standard=PSR2