PHPackages                             swordfox/silverstripe-shopify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. swordfox/silverstripe-shopify

ActiveSilverstripe-vendormodule

swordfox/silverstripe-shopify
=============================

Import Shopify products into your Silverstripe site, implements the buy button sdk to create a cart and checkout

1.4.0.8(7mo ago)21.4k3[6 issues](https://github.com/swordfox/silverstripe-shopify/issues)BSD-3-ClausePHPCI failing

Since Jun 2Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/swordfox/silverstripe-shopify)[ Packagist](https://packagist.org/packages/swordfox/silverstripe-shopify)[ RSS](/packages/swordfox-silverstripe-shopify/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (65)Used By (0)

Simple shopify module for SilverStripe sites
============================================

[](#simple-shopify-module-for-silverstripe-sites)

This module is for users that want to implement there shopify products into a SilverStripe storefront.

Based on [xddesigners/silverstripe-shopify](https://github.com/xddesigners/silverstripe-shopify) - but completely reworked.

- Collections are added / removed on a per product basis.
- Import task with options: default, productsonly &amp; productsall (See 'Set up import script' below).
- Buy Button scripts included in templates to make it easy to modify &amp; implement in your own way.
- Versioning removed.
- Images are not imported from Shopify, instead we use [Images.weserv.nl](https://images.weserv.nl/) - An image cache &amp; resize service.
- Optional: Webhooks from Shopify to keep your store updated without having to rely on the import task which can be resource consuming (See 'Set up webhooks' below).
- Optional: delete\_on\_shopify for shops that want to delete their products from Shopify after they have been sold, useful for shops that have one-off products (See 'Set up delete\_on\_shopify' below).

It makes use of the [Shopify Buy Button](https://www.shopify.com/buy-button) to create the cart and checkout interface.
You'll end up with a import job that fetches all the products and variants and stores them as Product DataObject in your site.

Requirements
------------

[](#requirements)

- SilverStripe 4.x

Installation
------------

[](#installation)

Install the module trough composer and configure the api keys.

```
composer require swordfox/silverstripe-shopify

```

Get up your api keys by creating a new Private App in your Shopify admin interface. If you want to use webhooks via the API e.g. dev/tasks/Swordfox-Shopify-Task-Webhooks/create you need to ensure 'webhooks\_shared\_secret' is the same as 'shared\_secret', however if you want to use manually added webhooks, you will need to get your webhooks shared secret from `admin/settings/notifications`

### Config

[](#config)

```
Swordfox\Shopify\Client:
  api_key: 'YOUR_API_KEY'
  api_password: 'YOUR_API_PASSWORD'
  api_limit: 50 # Default limit, 250 max
  api_version: '2021-01' # Default 2021-01
  storefront_access_token: 'YOUR_ACCESS_TOKEN' # for buybutton code
  shopify_domain: 'YOUR_SHOPIFY_DOMAIN' # mydomain.myshopify.com
  shared_secret: 'YOUR_API_SHARED_SECRET'
  webhooks_shared_secret: 'YOUR_WEBHOOKS_SHARED_SECRET' # Use same as above for webhooks added via API e.g. dev/tasks/Swordfox-Shopify-Task-Webhooks/create
  webhooks_create:
    'products/update': 'shop/webhook/update/product'
    'products/create': 'shop/webhook/update/product'
    'products/delete': 'shop/webhook/delete/product'
    'collections/create': 'shop/webhook/update/collection'
    'collections/update': 'shop/webhook/update/collection'
    'collections/delete': 'shop/webhook/delete/collection'
    'inventory_levels/connect': 'shop/webhook/update/inventory'
    'inventory_levels/update': 'shop/webhook/update/inventory'
  delete_on_shopify: false
  delete_on_shopify_after: '+3 days' # strtotime('+3 days')
  delete_on_shopify_keep_active: false
  hide_out_of_stock: false
  hide_if_no_image: false
  hide_if_collection_not_active: false
  new_based_on: 'Created' # LastEdited or ImageAdded (use with hide_if_no_image)
  new_timeframe: '+7 days' # strtotime('+7 days')
  cron_interval: '-18 hours' # Allow for timezone offset, e.g. if your timezone is +12:00, add your cron_interval to that as a negative value. So if your cron runs every 6 hours, set the cron_interval to '-18 hours'
  custom_metafields: true # product.metafields.custom.metatitle & product.metafields.custom.brand
  googlefeed_gtinbarcode: false # Show gtin as Barcode from Shopify
  googlefeed_mpnsku: true # Show mpn as SKU from Shopify
  googlefeed_condition: new # The condition of items
  googlefeed_storecode: 'code' # Show store_code in feed, e.g. Queenstown

# Override $default_sort
Swordfox\Shopify\Model\Product:
  default_sort: 'Created DESC' # LastEdited DESC or ImageAdded DESC
```

### Set up import script

[](#set-up-import-script)

You can run the import script manually trough the dev/tasks interface or set up up to run as a cron task. The default task is designed to run once per day and imports / updates the latest 50 `api_limit` from *admin/products.json*, *admin/custom\_collections.json* &amp; *admin/smart\_collections.json*. `http://example.com/dev/tasks/Swordfox-Shopify-Task-Import` or `sake dev/tasks/Swordfox-Shopify-Task-Import`

The productsonly task is designed to run a few times a day if webhooks are not being used, it imports the latest 50 `api_limit` from *admin/products.json*.

`http://example.com/dev/tasks/Swordfox-Shopify-Task-Import/productsonly` or `sake dev/tasks/Swordfox-Shopify-Task-Import/productsonly`

The productsall task is designed to run on initial set up and imports all from *admin/products.json*, *admin/custom\_collections.json* &amp; *admin/smart\_collections.json*.

`http://example.com/dev/tasks/Swordfox-Shopify-Task-Import/productsall` or `sake dev/tasks/Swordfox-Shopify-Task-Import/productsall`

### Set up webhooks

[](#set-up-webhooks)

The following webhooks are supported and can be created automatically via the API using `http://example.com/dev/tasks/Swordfox-Shopify-Task-Webhooks/create` or `sake dev/tasks/Swordfox-Shopify-Task-Webhooks/create`

- Collection creation
- Collection deletion
- Collection update
- Inventory level connect
- Inventory level update
- Product creation
- Product deletion
- Product update

[![Shopify webhooks](/readme/webhooks.png)](/readme/webhooks.png)

### Set up delete\_on\_shopify

[](#set-up-delete_on_shopify)

You can run the delete on Shopify script manually trough the dev/tasks interface or set up up to run as a cron task. This task is useful for stores that sell one-off products and want to delete the products off Shopify after a certain period of time `delete_on_shopify_after: '+3 days'` which is set on ShopifyProduct::DeleteOnShopify during the import tasks if `delete_on_shopify: true`

`http://example.com/dev/tasks/Swordfox-Shopify-Task-DeleteOnShopify` or `sake dev/tasks/Swordfox-Shopify-Task-DeleteOnShopify`

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance42

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 86.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~30 days

Recently: every ~91 days

Total

63

Last Release

237d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/96b760811dd50cc818deef02183cfabd8efacbc8f27af1c5f1fcde738980d2dd?d=identicon)[swordfox](/maintainers/swordfox)

---

Top Contributors

[![swordfox](https://avatars.githubusercontent.com/u/549500?v=4)](https://github.com/swordfox "swordfox (32 commits)")[![ebakernz](https://avatars.githubusercontent.com/u/4185091?v=4)](https://github.com/ebakernz "ebakernz (5 commits)")

---

Tags

silverstripeshopifybuybutton

### Embed Badge

![Health badge](/badges/swordfox-silverstripe-shopify/health.svg)

```
[![Health](https://phpackages.com/badges/swordfox-silverstripe-shopify/health.svg)](https://phpackages.com/packages/swordfox-silverstripe-shopify)
```

###  Alternatives

[silverstripe/userforms

UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code

1321.0M66](/packages/silverstripe-userforms)[dnadesign/silverstripe-elemental

Elemental pagetype and collection of Elements

111998.6k239](/packages/dnadesign-silverstripe-elemental)[silverstripe/frameworktest

Aids core and module developers in testing their code against a set of sample data and behaviour.

17300.1k13](/packages/silverstripe-frameworktest)[silverstripe/dms

Adds a Document Management System to SilverStripe

4013.8k1](/packages/silverstripe-dms)[bramdeleeuw/cookieconsent

GDPR compliant cookie bar and consent checker

1511.4k2](/packages/bramdeleeuw-cookieconsent)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
