diff --git a/app/views/shop/products.rabl b/app/views/shop/products.rabl index f14e3f1339..7d5f1711fe 100644 --- a/app/views/shop/products.rabl +++ b/app/views/shop/products.rabl @@ -1,8 +1,11 @@ collection @products -attributes :id, :name, :price, :permalink, :count_on_hand, :on_demand, :group_buy +attributes :id, :name, :permalink, :count_on_hand, :on_demand, :group_buy node do |product| - {notes: strip_tags(product.notes), - description: strip_tags(product.description)} + { + notes: strip_tags(product.notes), + description: strip_tags(product.description), + price: product.master.price_with_fees(current_distributor, current_order_cycle) + } end child :supplier => :supplier do @@ -20,7 +23,12 @@ child :master => :master do end child :variants => :variants do |variant| - attributes :id, :is_master, :price, :count_on_hand, :options_text, :count_on_hand, :on_demand, :group_buy + attributes :id, :is_master, :count_on_hand, :options_text, :count_on_hand, :on_demand, :group_buy + node do |variant| + { + price: variant.price_with_fees(current_distributor, current_order_cycle) + } + end child :images => :images do attributes :id, :alt node do |img| diff --git a/spec/controllers/shop_controller_spec.rb b/spec/controllers/shop_controller_spec.rb index 8c83de891d..6b539fdbef 100644 --- a/spec/controllers/shop_controller_spec.rb +++ b/spec/controllers/shop_controller_spec.rb @@ -138,6 +138,12 @@ describe ShopController do response.body.should have_content "frogs" response.body.should_not have_content "