diff --git a/app/helpers/add_to_cart_helper.rb b/app/helpers/add_to_cart_helper.rb index 6a1eec813f..aca2c97af0 100644 --- a/app/helpers/add_to_cart_helper.rb +++ b/app/helpers/add_to_cart_helper.rb @@ -1,8 +1,4 @@ module AddToCartHelper - def product_out_of_stock - !@product.has_stock? && !Spree::Config[:allow_backorders] - end - def distributor_available_for?(order, product) DistributionChangeValidator.new(order).distributor_available_for?(product) end diff --git a/app/views/spree/products/_add_to_cart.html.haml b/app/views/spree/products/_add_to_cart.html.haml index dd406ff50b..3e318205bf 100644 --- a/app/views/spree/products/_add_to_cart.html.haml +++ b/app/views/spree/products/_add_to_cart.html.haml @@ -1,7 +1,7 @@ .add-to-cart - order = current_order(false) - - if product_out_of_stock + - if !@product.has_stock? = content_tag('strong', t(:out_of_stock)) - elsif !distributor_available_for?(order, @product)