From 41917374132a138c25d459081aa0fad745692784 Mon Sep 17 00:00:00 2001 From: Mayur Shah Date: Mon, 2 Dec 2024 23:26:12 +0530 Subject: [PATCH] Updated sample data for brand --- sample/db/samples/products.rb | 11 +++++++++++ sample/db/samples/taxonomies.rb | 2 +- sample/db/samples/taxons.rb | 12 +++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/sample/db/samples/products.rb b/sample/db/samples/products.rb index e2245c24b15..3a7558a5986 100644 --- a/sample/db/samples/products.rb +++ b/sample/db/samples/products.rb @@ -153,6 +153,17 @@ height: 20, width: 10, depth: 5 + }, + { + name: "Solidus laptop", + tax_category:, + shipping_category:, + price: 18.99, + eur_price: 20, + weight: 10, + height: 20, + width: 10, + depth: 5 } ] diff --git a/sample/db/samples/taxonomies.rb b/sample/db/samples/taxonomies.rb index 3c4614b6131..8ceada0cf5e 100644 --- a/sample/db/samples/taxonomies.rb +++ b/sample/db/samples/taxonomies.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -store = Spree::Store.where(code: 'sample-store').first +store = Spree::Store.find_by!(code: 'sample-store') taxonomies = [ { name: "Categories", store: }, diff --git a/sample/db/samples/taxons.rb b/sample/db/samples/taxons.rb index 8d96e53e3a8..9fa0e8560eb 100644 --- a/sample/db/samples/taxons.rb +++ b/sample/db/samples/taxons.rb @@ -4,6 +4,7 @@ Spree::Sample.load_sample("products") categories = Spree::Taxonomy.find_by!(name: "Categories") +brands = Spree::Taxonomy.find_by!(name: "Brands") products = { solidus_bottles: "Solidus Water Bottle", @@ -17,7 +18,8 @@ solidus_long_sleeve_tee: "Solidus long sleeve tee", solidus_dark_tee: "Solidus dark tee", solidus_canvas_tote: "Solidus canvas tote bag", - solidus_cap: "Solidus cap" + solidus_cap: "Solidus cap", + solidus_laptop: "Solidus laptop" } products.each do |key, name| @@ -90,6 +92,14 @@ products: [ products[:solidus_hoodie], ] + }, + { + name: "Laptop", + taxonomy: brands, + parent: "Brands", + products: [ + products[:solidus_laptop] + ] } ]