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
Make option types in sample products and their variants consistent
Piotr Matląg02c20481290a
diff --git a/sample/db/samples/products.rb b/sample/db/samples/products.rbindex cb52fe7cc6..7cec89eb13 100644--- a/sample/db/samples/products.rb+++ b/sample/db/samples/products.rb@@ -11,6 +11,7 @@ clothing_tax_category = Spree::TaxCategory.find_by!(name: 'Clothing')Spree::Config[:currency] = 'USD'color = Spree::OptionType.find_by!(name: 'color')+length = Spree::OptionType.find_by!(name: 'length')size = Spree::OptionType.find_by!(name: 'size')PRODUCTS = CSV.read(File.join(__dir__, 'variants.csv')).map do |(parent_name, taxon_name, product_name, _color_name)|@@ -24,7 +25,11 @@ PRODUCTS.each do |(parent_name, taxon_name, product_name)|product.price = rand(10...100) + 0.99product.description = FFaker::Lorem.paragraphproduct.available_on = Time.zone.now- product.option_types = [color, size]+ if parent_name == 'Women' and %w[Dresses Skirts].include?(taxon_name)+ product.option_types = [color, length, size]+ else+ product.option_types = [color, size]+ endproduct.shipping_category = default_shipping_categoryproduct.tax_category = clothing_tax_categoryproduct.sku = [taxon_name.delete(' '), product_name.delete(' '), product.price].join('_')