diff --git a/app/serializers/spree/image_serializer.rb b/app/serializers/spree/image_serializer.rb new file mode 100644 index 0000000000..0cf3ee8295 --- /dev/null +++ b/app/serializers/spree/image_serializer.rb @@ -0,0 +1,6 @@ +module Spree + + class ImageSerializer < ActiveModel::Serializer + attributes :id, :mini_url, :alt + end +end diff --git a/app/serializers/spree/variant_serializer.rb b/app/serializers/spree/variant_serializer.rb index cc7e3f4da4..37193a264c 100644 --- a/app/serializers/spree/variant_serializer.rb +++ b/app/serializers/spree/variant_serializer.rb @@ -1,6 +1,6 @@ module Spree class VariantSerializer < ActiveModel::Serializer - attributes :id, :is_master, :count_on_hand + attributes :id, :is_master, :count_on_hand, :options_text has_many :images end end diff --git a/app/views/shop/_products.html.haml b/app/views/shop/_products.html.haml index 3bab49c5f5..4770555f98 100644 --- a/app/views/shop/_products.html.haml +++ b/app/views/shop/_products.html.haml @@ -1,14 +1,17 @@ %products{"ng-controller" => "ProductsCtrl"} %table %thead - %th Item + %th{colspan: 2} Item %th Description %th Variant %th QTY %th Bulk %th Price %tr.product{"ng-repeat" => "product in data.products "} - %td {{ product.name }} + %td + %img{src: "{{ product.master.images[0].mini_url }}", alt: "{{product.master.images[0].alt}}"} + %td + {{ product.name }} %td {{ product.description }} %td {{ product.master.id }} %td Quantity thing @@ -18,5 +21,4 @@ %small from $ {{ product.price }} - %pre {{ data.products | json }}