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.

Add products to Summer 2021 and 30% off taxons. (#11260)

Matthew Kennedy04a09f7015d6
diff --git a/sample/db/samples/products.rb b/sample/db/samples/products.rb
index 79c9f7cace..3e58678070 100644
--- a/sample/db/samples/products.rb
+++ b/sample/db/samples/products.rb
@@ -40,7 +40,7 @@ PRODUCTS.each do |(parent_name, taxon_name, product_name)|
end
end
-Spree::Taxon.where(name: ['Bestsellers', 'New', 'Trending', 'Streetstyle', 'Summer Sale']).each do |taxon|
+Spree::Taxon.where(name: ['Bestsellers', 'New', 'Trending', 'Streetstyle', 'Summer Sale', "Summer #{Date.today.year}", '30% Off']).each do |taxon|
next if taxon.products.any?
taxon.products << Spree::Product.all.sample(30)