This is the VersaCommerce App Template build on Bootstrap 3. To get the ball rolling: It uses the VersaCommerce API GEM for accessing the VersaCommerce admin REST web services. It is build with the versacommerce_app generator which provides a module to ensure the API-Session.
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 VersaCommerce API is being used. It's located at views/home/index.html.erb
Check out the sessions_controller
The sessions-controller in this demo application makes sure, you are connected to a VersaCommerce Shop. If not, it asks you to register (install) your app with a shop. After authorisation it calls the action sessions#finalize
. If you want to store the "registration-token" token
for unattended usage, you can place your code right here.
<%= link_to 'API documentation', 'https://github.com/versacommerce/vc-api' %>
Learn what you can do with the VersaCommerce API
<%= link_to 'Bootstrap documentation', 'http://twitter.github.com/bootstrap/' %>
Find out what you can do with Twitter Bootstrap
Name
<%= current_shop.shop.name %>
URL
<%= current_shop.shop.url %>
Price includes tax
<%= current_shop.shop.price_includes_tax%>
Currency
<%= current_shop.shop.currency_code%>
There are no orders in your shop. |
Order | Customer | Status | Total |
---|---|---|---|
<%= link_to order.code, "https://#{current_shop.url}/admin/orders/#{order.id}", :target => 'blank' %> | <%= "#{order.billing_address.firstname} #{order.billing_address.lastname}" %> | <%= order.status %> | <%= order.total %> <%= order.currency %> |
SKU: <%= product.code %>
Category: <%= product.category %>
Vendor: <%= product.vendor %>
<%= raw(product.description_html) %>Created at <%= product.created_on.strftime("%Y-%m-%d") %>