Skip to content

Commit

Permalink
Updated sample data for brand
Browse files Browse the repository at this point in the history
  • Loading branch information
shahmayur001 committed Dec 2, 2024
1 parent fd9f796 commit 4191737
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
11 changes: 11 additions & 0 deletions sample/db/samples/products.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]

Expand Down
2 changes: 1 addition & 1 deletion sample/db/samples/taxonomies.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

store = Spree::Store.where(code: 'sample-store').first
store = Spree::Store.find_by!(code: 'sample-store')

This comment has been minimized.

Copy link
@fthobe

fthobe Dec 2, 2024

Contributor

Why is this change required?

This comment has been minimized.

Copy link
@shahmayur001

shahmayur001 Dec 2, 2024

Author Contributor

Its an improvement


taxonomies = [
{ name: "Categories", store: },
Expand Down
12 changes: 11 additions & 1 deletion sample/db/samples/taxons.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"

This comment has been minimized.

Copy link
@fthobe

fthobe Dec 2, 2024

Contributor

Do not create a new product

}

products.each do |key, name|
Expand Down Expand Up @@ -90,6 +92,14 @@
products: [
products[:solidus_hoodie],
]
},
{
name: "Laptop",

This comment has been minimized.

Copy link
@fthobe

fthobe Dec 2, 2024

Contributor

Replace with Solidus

taxonomy: brands,
parent: "Brands",
products: [
products[:solidus_laptop]
]
}
]

Expand Down

0 comments on commit 4191737

Please sign in to comment.