Gulp dump shopify
The purpose of this plugin is to grab some datas from Shopify API and to consolidate them in a single JSON file.
Also this file will try to match as much as possible Shopify's Objects
The main use case should be to render a static integration with some datas similar to Shopify's one.
Install
npm install gulp-dump-shopify --save-dev
Use
You will need some credentials from Shopify (see creating-a-private-app)
var gulp = ;var dumpShopify = ; gulp;
Additional options
gulp-dump-shopify can take a debug
option. If set to true
, it will also write all results from api calls, and split the dump file in a general, collections & products files.
Handle collections & products references
To avoid circular references in JSON, all references of products and collections are only made with ids.
You should replace them with “real” products/collections in order to be closer of Shopify's Object.
var shopify = ;var collections = shopifycollections;var products = shopifyproducts; // reference products in collections { return productsproductId;}for let collectionName in collections let coll = collectionscollectionName; collproducts = collproducts; // reference collections in products { return collectionscollectionId;}for let productId in products let prod = productsproductId; prodcollections = prodcollections; // feed those datas to some templates// …