diff --git a/app/serializers/spree/product_serializer.rb b/app/serializers/spree/product_serializer.rb index 87cb4e2750..2dae29f94c 100644 --- a/app/serializers/spree/product_serializer.rb +++ b/app/serializers/spree/product_serializer.rb @@ -1,6 +1,6 @@ module Spree class ProductSerializer < ActiveModel::Serializer - attributes :id, :name, :description + attributes :id, :name, :description, :price has_one :master end diff --git a/app/views/shop/_products.html.haml b/app/views/shop/_products.html.haml index 6d7a133c1f..e0945bf26e 100644 --- a/app/views/shop/_products.html.haml +++ b/app/views/shop/_products.html.haml @@ -1,23 +1,30 @@ %products{"ng-controller" => "ProductsCtrl"} - %table - %thead - %th{colspan: 2} Item - %th Description - %th Variant - %th QTY - %th Bulk - %th Price - %tr.product{"ng-repeat" => "product in data.products "} - %td - %td - {{ product.name }} - %td {{ product.description }} - %td {{ product.master.id }} - %td Quantity thing - %td.group_buy{"ng-class" => "{enabled: product.group_buy}"} - Not available - %td.price - %small from - $ {{ product.price }} + %form.custom + %table + %thead + %th{colspan: 2} Item + %th Description + %th Variant + %th QTY + %th Bulk + %th Price + %tr.product{"ng-repeat" => "product in data.products "} + %td + {{ product.master.images[0].mini_url }} + {{product.master.images[0].alt}} + %td + {{ product.name }} + %td {{ product.description }} + %td {{ product.master.options_text }} + %td + %input{type: :number, id: "quantity_product_{{product.id}}"} + %td.group_buy + %span{"ng-show" => "{enabled: product.group_buy}"} + Available + %span{"ng-hide" => "{enabled: product.group_buy}"} + Not available + %td.price + %small from + $ {{ product.price }} %pre {{ data.products | json }} diff --git a/spec/features/consumer/shopping_spec.rb b/spec/features/consumer/shopping_spec.rb index 226d57eb67..508856d761 100644 --- a/spec/features/consumer/shopping_spec.rb +++ b/spec/features/consumer/shopping_spec.rb @@ -49,7 +49,6 @@ feature "As a consumer I want to shop with a distributor", js: true do before do exchange = Exchange.find(oc1.exchanges.to_enterprises(distributor).outgoing.first.id) exchange.variants << product.master - visit shop_path end @@ -68,9 +67,7 @@ feature "As a consumer I want to shop with a distributor", js: true do select "frogs", :from => "order_cycle_id" page.should have_content product.name end - end - end context "when no order cycles are available" do @@ -89,7 +86,6 @@ feature "As a consumer I want to shop with a distributor", js: true do page.should have_content "The next cycle opens in 10 days" end end - end end end