An intro to using the Shopify App Template
including information on the Shopify API and Bootstrap,
just to get the ball rolling.
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
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
You can become an expert pretty quickly by reading up on these docs:
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' %>.
There are no orders in your store. |
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 %> |
Type: <%= product.product_type %>
Vendor: <%= product.vendor %>
<%= raw(product.body_html) %>
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' %>