From 9d33ef460c28cdeb97da36de61a40c7e5170c6cb Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Sat, 4 Aug 2012 16:51:43 +1000 Subject: [PATCH] Max quantity field doesn't affect JS price calcs on products without variants --- app/assets/javascripts/store/products.js | 2 +- app/views/spree/products/_add_to_cart.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/store/products.js b/app/assets/javascripts/store/products.js index 8cbfc57345..bd5aa329be 100644 --- a/app/assets/javascripts/store/products.js +++ b/app/assets/javascripts/store/products.js @@ -9,7 +9,7 @@ $(document).ready(function() { $("#quantity").change(); // Product page with master price only - $(".add-to-cart input.title:not(#quantity):not(#max_quantity)").change(products_update_price_without_variant).change(); + $(".add-to-cart input.title:not(#quantity):not(.max_quantity)").change(products_update_price_without_variant).change(); }); diff --git a/app/views/spree/products/_add_to_cart.html.haml b/app/views/spree/products/_add_to_cart.html.haml index 7e20e3134c..62f164c8d4 100644 --- a/app/views/spree/products/_add_to_cart.html.haml +++ b/app/views/spree/products/_add_to_cart.html.haml @@ -13,7 +13,7 @@ = number_field_tag (@product.has_variants? ? :quantity : "variants[#{@product.master.id}]"), 1, :class => 'title', :in => 1..@product.on_hand - if @product.group_buy %p Max quantity - = number_field_tag (@product.has_variants? ? :max_quantity : "variant_attributes[#{@product.master.id}][max_quantity]"), 1, :class => 'title', :in => 1..@product.on_hand + = number_field_tag (@product.has_variants? ? :max_quantity : "variant_attributes[#{@product.master.id}][max_quantity]"), 1, :class => 'title max_quantity', :in => 1..@product.on_hand - order = current_order(false) - if order.nil? || order.can_change_distributor? %p Distributor