Skip to content

cazzzt/shopify-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚧 Work in progress 🚧

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%