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.

Skip code dependant on page builder in core

Damian Legawiec15159a4aa034
diff --git a/core/app/jobs/spree/products/touch_taxons_job.rb b/core/app/jobs/spree/products/touch_taxons_job.rb
index 8a36eca08b..a318661b69 100644
--- a/core/app/jobs/spree/products/touch_taxons_job.rb
+++ b/core/app/jobs/spree/products/touch_taxons_job.rb
@@ -6,7 +6,7 @@ module Spree
def perform(taxon_ids, taxonomy_ids)
Spree::Taxon.where(id: taxon_ids).update_all(updated_at: Time.current)
Spree::Taxonomy.where(id: taxonomy_ids).update_all(updated_at: Time.current)
- Spree::Taxons::TouchFeaturedSections.call(taxon_ids: taxon_ids)
+ Spree::Taxons::TouchFeaturedSections.call(taxon_ids: taxon_ids) if defined?(Spree::Taxons::TouchFeaturedSections)
end
end
end
diff --git a/core/app/services/spree/products/auto_match_taxons.rb b/core/app/services/spree/products/auto_match_taxons.rb
index 790a06ca1e..ef2f8fb291 100644
--- a/core/app/services/spree/products/auto_match_taxons.rb
+++ b/core/app/services/spree/products/auto_match_taxons.rb
@@ -40,7 +40,7 @@ module Spree
all_affected_taxons = (taxons_to_remove + taxons_to_add).uniq
- if all_affected_taxons.any?
+ if all_affected_taxons.any? && defined?(Spree::Taxons::TouchFeaturedSections)
Spree::Taxons::TouchFeaturedSections.call(taxon_ids: all_affected_taxons.pluck(:id))
product.touch
end
diff --git a/core/app/services/spree/taxons/add_products.rb b/core/app/services/spree/taxons/add_products.rb
index c749d843e5..5ca67b6aa2 100644
--- a/core/app/services/spree/taxons/add_products.rb
+++ b/core/app/services/spree/taxons/add_products.rb
@@ -33,7 +33,7 @@ module Spree
taxon_ids = taxons.pluck(:id)
Spree::Taxon.where(id: taxon_ids).touch_all
- Spree::Taxons::TouchFeaturedSections.call(taxon_ids: taxon_ids)
+ Spree::Taxons::TouchFeaturedSections.call(taxon_ids: taxon_ids) if defined?(Spree::Taxons::TouchFeaturedSections)
success(true)
end