Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jeppos/shopify-php-sdk

An easy to use Shopify PHP SDK.
https://github.com/jeppos/shopify-php-sdk

api-client api-wrapper php php71 shopify shopify-api shopify-sdk

Last synced: 1 day ago
JSON representation

An easy to use Shopify PHP SDK.

Awesome Lists containing this project

README

        

shopify-php-sdk
==
An easy to use Shopify PHP SDK.

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/413a799a1ec944ab84e1050216591b5b)](https://www.codacy.com/app/jeppos/shopify-php-sdk?utm_source=github.com&utm_medium=referral&utm_content=jeppos/shopify-php-sdk&utm_campaign=Badge_Grade)
[![Build Status](https://travis-ci.org/jeppos/shopify-php-sdk.svg?branch=master)](https://travis-ci.org/jeppos/shopify-php-sdk)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/413a799a1ec944ab84e1050216591b5b)](https://www.codacy.com/app/jeppos/shopify-php-sdk?utm_source=github.com&utm_medium=referral&utm_content=jeppos/shopify-php-sdk&utm_campaign=Badge_Coverage)

# Installation
## Composer

```
composer require jeppos/shopify-php-sdk
```

# Usage

## Configure

Create a private app using the instructions found on [Shopify's own documentation](https://help.shopify.com/manual/apps/private-apps), to generate the required credentials.

```php
products->getOne(123);

// Display the product title
echo $product->getTitle();
```

### Fetch a list of custom collections

```php
// Get an array of CustomCollection classes
$customCollections = $shopifySDK->customCollections->getList();

// Display the title of each custom collection on a new line
foreach ($customCollections as $customCollection) {
echo $customCollection->getTitle() . PHP_EOL;
}
```

### Create a product

```php
$product = new Product();
$product->setTitle('My new product');

$shopifySDK->products->createOne($product);
```