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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Added `Product#archived` and `#not_archived` scopes
Damian Legawiec8027aa8fc895
diff --git a/core/app/models/concerns/spree/product_scopes.rb b/core/app/models/concerns/spree/product_scopes.rbindex a4e852b6cc..28a6596f90 100644--- a/core/app/models/concerns/spree/product_scopes.rb+++ b/core/app/models/concerns/spree/product_scopes.rb@@ -246,7 +246,7 @@ module Spreedef self.not_discontinued(only_not_discontinued = true)if only_not_discontinued != '0' && only_not_discontinued- where.not(status: 'archived')+ not_archivedelseallenddiff --git a/core/app/models/spree/product.rb b/core/app/models/spree/product.rbindex 0a6555e49c..b125c66e1a 100644--- a/core/app/models/spree/product.rb+++ b/core/app/models/spree/product.rb@@ -152,6 +152,9 @@ module Spreevalidate :discontinue_on_must_be_later_than_make_active_at, if: -> { make_active_at && discontinue_on }scope :for_store, ->(store) { joins(:store_products).where(StoreProduct.table_name => { store_id: store.id }) }+ scope :draft, -> { where(status: 'draft') }+ scope :archived, -> { where(status: 'archived') }+ scope :not_archived, -> { where.not(status: 'archived') }attr_accessor :option_values_hash