Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Use variant stock_items directly to check backorderable.

Sebastian Palma7171765804a1
diff --git a/api/app/models/spree/api/webhooks/stock_item_decorator.rb b/api/app/models/spree/api/webhooks/stock_item_decorator.rb
index 23e81d6ea4..44393648ae 100644
--- a/api/app/models/spree/api/webhooks/stock_item_decorator.rb
+++ b/api/app/models/spree/api/webhooks/stock_item_decorator.rb
@@ -19,7 +19,7 @@ module Spree
end
def variant_backorderable?
- Spree::Variant.backorderable.exists?(id: variant.id)
+ variant.stock_items.exists?(backorderable: true)
end
end
end