Where do I start?

An intro to using the Shopify App Template
including information on the Shopify API and Bootstrap,
just to get the ball rolling.

Check out the home_controller


The controller in this demo application fetches the newest 5 orders and products and makes them available as instance variables @orders and @products


Take a look at index.html.erb


Index is the Ruby template you are currently viewing. Have a look at the markup and Ruby code to see how the Shopify API is being used. It's located at views/home/index.html.erb

Additional Docs

You can become an expert pretty quickly by reading up on these docs:


Once you're ready

We'd love to see what you create using the Shopify API. You can keep up to date on the latest and greatest via the <%= link_to 'Shopify Developers Twitter Account', 'https://twitter.com/shopifydevs' %>. You can also read the latest information on the <%= link_to 'Building a Shopify App', 'http://docs.shopify.com/partners/partner-resources/for-partners/building-a-shopify-app' %>.


Recent orders

<% if @orders.none? %>
There are no orders in your store.
<% else %> <% @orders.each do |order| %> <% end %>
Order Placed by Paid Fulfillment Total
<%= link_to order.name, "https://#{shop_session.url}/admin/orders/#{order.id}", :target => 'blank' %> <%= customer_name(order) %> <%= order.financial_status %> <% if !order.fulfillment_status %> Not Fulfilled <% else %> Fulfilled <% end %> <%= order.total_price %> <%= order.currency %>
<% end %>

New Products

<% if @products.none? %>
There are no products in your store.
<% else %> <% @products.each_with_index do |product, index| %>
<% if !product.images.empty? %>
<%= link_to image_tag(product.images.first.medium), '#modal-'+product.id.to_s, :'data-toggle' => 'modal' %>
<% end %>

Type: <%= product.product_type %>

Vendor: <%= product.vendor %>

<%= raw(product.body_html) %>


<% if product.published_at != nil %>

Published at <%= Time.parse(product.published_at).strftime("%H:%M on %m/%d/%Y") %>

<% end %>

<%= link_to raw('View in your Shopify Admin '), "https://#{shop_session.url}/admin/products/#{product.id}", :target => 'blank', :class => 'btn btn-primary' %>

<% end %> <% end %>