Merge pull request #3496 from luisramos0/2-0-kill-allow-backorders

[Spree Upgrade] Remove allow_backorders from product stock verification
This commit is contained in:
Maikel
2019-02-20 13:09:05 +11:00
committed by GitHub
2 changed files with 1 additions and 5 deletions

View File

@@ -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

View File

@@ -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)