mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user