Skip to content

Instantly share code, notes, and snippets.

@myjanky
Created April 8, 2016 14:31
Show Gist options
  • Save myjanky/ef77337ae54c5bbcfebdc98fd8f540cb to your computer and use it in GitHub Desktop.
Save myjanky/ef77337ae54c5bbcfebdc98fd8f540cb to your computer and use it in GitHub Desktop.

Shopify store data widget by Larry Wheeler

Preview

Description

Widget for Dashing that shows data from your Shopify shop.

Usage

To use this widget, copy shopify.html, shopify.coffee, and shopify.scss into a /widgets/shopify directory, and copy the shopify.rb file into your /jobs folder.

To include the widget in a dashboard, add the following snippet to the dashboard layout file:

<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
    <div data-id="shopify" data-view="Shopify" data-title="Shopify" style="background-color:#47bbb3;"></div>
    <i class="icon-shopping-cart icon-background"></i>
</li>
.widget-shopify {
}
<h1 class="title" data-bind="title"></h1>
<h4>
Open Orders count
</h4>
<div data-bind="value"></div>
<p class="more-info" data-bind="moreinfo"></p>
<p class="updated-at" data-bind="updatedAtMessage"></p>
require 'shopify_api'
login = ''
secret = ''
shop = ''
shop_url = "https://" login ":" secret "@" shop ".myshopify.com/admin"
ShopifyAPI::Base.site = shop_url
shop = ShopifyAPI::Shop.current
# /admin/orders/count.json
# Get a specific product
orderCount = ShopifyAPI::Order.count()
SCHEDULER.every '30s', :first_in => 0 do |job|
send_event('shopify', {value: orderCount})
end
@MrPauls
Copy link

MrPauls commented Jul 19, 2016

Possible to get the coffee file added?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment