solidus_sample 2.9.5 → 2.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/samples/assets.rb +79 -40
- data/db/samples/images/ruby_hoodie.jpg +0 -0
- data/db/samples/images/ruby_hoodie_zip.jpg +0 -0
- data/db/samples/images/ruby_mug.jpg +0 -0
- data/db/samples/images/ruby_polo.jpg +0 -0
- data/db/samples/images/ruby_polo_back.jpg +0 -0
- data/db/samples/images/solidus_girly.jpg +0 -0
- data/db/samples/images/solidus_girly_black.png +0 -0
- data/db/samples/images/solidus_girly_blue.png +0 -0
- data/db/samples/images/solidus_girly_white.png +0 -0
- data/db/samples/images/solidus_hoodie.jpg +0 -0
- data/db/samples/images/solidus_long.jpg +0 -0
- data/db/samples/images/solidus_long_back.jpg +0 -0
- data/db/samples/images/solidus_long_back_black.png +0 -0
- data/db/samples/images/solidus_long_back_blue.png +0 -0
- data/db/samples/images/solidus_long_back_white.png +0 -0
- data/db/samples/images/solidus_long_black.png +0 -0
- data/db/samples/images/solidus_long_blue.png +0 -0
- data/db/samples/images/solidus_long_white.png +0 -0
- data/db/samples/images/solidus_mug.jpg +0 -0
- data/db/samples/images/solidus_snapback_cap.jpg +0 -0
- data/db/samples/images/solidus_tshirt.jpg +0 -0
- data/db/samples/images/solidus_tshirt_back.jpg +0 -0
- data/db/samples/images/solidus_tshirt_back_black.png +0 -0
- data/db/samples/images/solidus_tshirt_back_blue.png +0 -0
- data/db/samples/images/solidus_tshirt_back_white.png +0 -0
- data/db/samples/images/solidus_tshirt_black.png +0 -0
- data/db/samples/images/solidus_tshirt_blue.png +0 -0
- data/db/samples/images/solidus_tshirt_white.png +0 -0
- data/db/samples/images/tote_bag_ruby.jpg +0 -0
- data/db/samples/images/tote_bag_solidus.jpg +0 -0
- data/db/samples/option_values.rb +13 -1
- data/db/samples/orders.rb +3 -3
- data/db/samples/product_option_types.rb +3 -3
- data/db/samples/product_properties.rb +78 -28
- data/db/samples/products.rb +97 -27
- data/db/samples/taxons.rb +58 -40
- data/db/samples/variants.rb +149 -62
- data/solidus_sample.gemspec +1 -1
- metadata +35 -25
- data/db/samples/images/apache_baseball.png +0 -0
- data/db/samples/images/ror_bag.jpeg +0 -0
- data/db/samples/images/ror_baseball.jpeg +0 -0
- data/db/samples/images/ror_baseball_back.jpeg +0 -0
- data/db/samples/images/ror_baseball_jersey_back_blue.png +0 -0
- data/db/samples/images/ror_baseball_jersey_back_green.png +0 -0
- data/db/samples/images/ror_baseball_jersey_back_red.png +0 -0
- data/db/samples/images/ror_baseball_jersey_blue.png +0 -0
- data/db/samples/images/ror_baseball_jersey_green.png +0 -0
- data/db/samples/images/ror_baseball_jersey_red.png +0 -0
- data/db/samples/images/ror_jr_spaghetti.jpeg +0 -0
- data/db/samples/images/ror_mug.jpeg +0 -0
- data/db/samples/images/ror_mug_back.jpeg +0 -0
- data/db/samples/images/ror_ringer.jpeg +0 -0
- data/db/samples/images/ror_ringer_back.jpeg +0 -0
- data/db/samples/images/ror_stein.jpeg +0 -0
- data/db/samples/images/ror_stein_back.jpeg +0 -0
- data/db/samples/images/ror_tote.jpeg +0 -0
- data/db/samples/images/ror_tote_back.jpeg +0 -0
- data/db/samples/images/ruby_baseball.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9d613b41f157f92e162bbd1fdb2d44964f21396d0ba93132504202165f674a9
|
4
|
+
data.tar.gz: 65651899c1475d102546fbe2752162e9ce82b86d6405db6993e5c1a7bcb322a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cd7043e1b10ded969b3cd1eb98f1641c97cc6b188447ac72a9a574557a96093139fc7295b4a8dc149617121d64fc3216d022c02b315a39829653e00b4fd178c
|
7
|
+
data.tar.gz: 79b6e0a60a96bf3c4b3638e1beff11cd208c5233746b75ffc971366495e953ae9a25445c58dad43d7657c26b94db983f33185bd090ba90f13820f7d27dc119df
|
data/db/samples/assets.rb
CHANGED
@@ -4,99 +4,138 @@ Spree::Sample.load_sample("products")
|
|
4
4
|
Spree::Sample.load_sample("variants")
|
5
5
|
|
6
6
|
products = {}
|
7
|
-
products[:
|
8
|
-
products[:
|
9
|
-
products[:
|
10
|
-
products[:
|
11
|
-
products[:
|
12
|
-
products[:
|
13
|
-
products[:
|
14
|
-
products[:
|
15
|
-
products[:
|
7
|
+
products[:solidus_tshirt] = Spree::Product.includes(variants: [:option_values]).find_by!(name: "Solidus T-Shirt")
|
8
|
+
products[:solidus_long] = Spree::Product.includes(variants: [:option_values]).find_by!(name: "Solidus Long Sleeve")
|
9
|
+
products[:solidus_girly] = Spree::Product.includes(variants: [:option_values]).find_by!(name: "Solidus Girly")
|
10
|
+
products[:solidus_snapback_cap] = Spree::Product.find_by!(name: "Solidus Snapback Cap")
|
11
|
+
products[:solidus_hoodie] = Spree::Product.find_by!(name: "Solidus Hoodie Zip")
|
12
|
+
products[:ruby_hoodie] = Spree::Product.find_by!(name: "Ruby Hoodie")
|
13
|
+
products[:ruby_hoodie_zip] = Spree::Product.find_by!(name: "Ruby Hoodie Zip")
|
14
|
+
products[:ruby_polo] = Spree::Product.find_by!(name: "Ruby Polo")
|
15
|
+
products[:solidus_mug] = Spree::Product.find_by!(name: "Solidus Mug")
|
16
|
+
products[:ruby_mug] = Spree::Product.find_by!(name: "Ruby Mug")
|
17
|
+
products[:solidus_tote] = Spree::Product.find_by!(name: "Solidus Tote")
|
18
|
+
products[:ruby_tote] = Spree::Product.find_by!(name: "Ruby Tote")
|
16
19
|
|
17
|
-
def image(name, type = "
|
20
|
+
def image(name, type = "jpg")
|
18
21
|
images_path = Pathname.new(File.dirname(__FILE__)) + "images"
|
19
22
|
path = images_path + "#{name}.#{type}"
|
23
|
+
|
20
24
|
return false if !File.exist?(path)
|
25
|
+
|
21
26
|
path
|
22
27
|
end
|
23
28
|
|
24
29
|
images = {
|
25
|
-
products[:
|
30
|
+
products[:solidus_tshirt].master => [
|
26
31
|
{
|
27
|
-
attachment: image("
|
32
|
+
attachment: image("solidus_tshirt")
|
28
33
|
},
|
29
34
|
{
|
30
|
-
attachment: image("
|
35
|
+
attachment: image("solidus_tshirt_back")
|
31
36
|
}
|
32
37
|
],
|
33
|
-
products[:
|
38
|
+
products[:solidus_long].master => [
|
34
39
|
{
|
35
|
-
attachment: image("
|
40
|
+
attachment: image("solidus_long")
|
41
|
+
},
|
42
|
+
{
|
43
|
+
attachment: image("solidus_long_back")
|
36
44
|
}
|
37
45
|
],
|
38
|
-
products[:
|
46
|
+
products[:solidus_snapback_cap].master => [
|
39
47
|
{
|
40
|
-
attachment: image("
|
41
|
-
},
|
42
|
-
{
|
43
|
-
attachment: image("ror_baseball_back")
|
48
|
+
attachment: image("solidus_snapback_cap")
|
44
49
|
}
|
45
50
|
],
|
46
|
-
products[:
|
51
|
+
products[:solidus_hoodie].master => [
|
47
52
|
{
|
48
|
-
attachment: image("
|
53
|
+
attachment: image("solidus_hoodie")
|
49
54
|
}
|
50
55
|
],
|
51
|
-
products[:
|
56
|
+
products[:ruby_hoodie].master => [
|
52
57
|
{
|
53
|
-
attachment: image("
|
54
|
-
}
|
58
|
+
attachment: image("ruby_hoodie")
|
59
|
+
}
|
60
|
+
],
|
61
|
+
products[:ruby_hoodie_zip].master => [
|
55
62
|
{
|
56
|
-
attachment: image("
|
63
|
+
attachment: image("ruby_hoodie_zip")
|
57
64
|
}
|
58
65
|
],
|
59
|
-
products[:
|
66
|
+
products[:ruby_polo].master => [
|
60
67
|
{
|
61
|
-
attachment: image("
|
68
|
+
attachment: image("ruby_polo")
|
62
69
|
},
|
63
70
|
{
|
64
|
-
attachment: image("
|
71
|
+
attachment: image("ruby_polo_back")
|
65
72
|
}
|
66
73
|
],
|
67
|
-
products[:
|
74
|
+
products[:solidus_mug].master => [
|
68
75
|
{
|
69
|
-
attachment: image("
|
70
|
-
}
|
76
|
+
attachment: image("solidus_mug")
|
77
|
+
}
|
78
|
+
],
|
79
|
+
products[:ruby_mug].master => [
|
71
80
|
{
|
72
|
-
attachment: image("
|
81
|
+
attachment: image("ruby_mug")
|
73
82
|
}
|
74
83
|
],
|
75
|
-
products[:
|
84
|
+
products[:solidus_tote].master => [
|
76
85
|
{
|
77
|
-
attachment: image("
|
86
|
+
attachment: image("tote_bag_solidus")
|
78
87
|
}
|
79
88
|
],
|
80
|
-
products[:
|
89
|
+
products[:ruby_tote].master => [
|
81
90
|
{
|
82
|
-
attachment: image("
|
91
|
+
attachment: image("tote_bag_ruby")
|
92
|
+
}
|
93
|
+
],
|
94
|
+
products[:solidus_girly].master => [
|
95
|
+
{
|
96
|
+
attachment: image("solidus_girly")
|
83
97
|
}
|
84
98
|
]
|
85
99
|
}
|
86
100
|
|
87
|
-
products[:
|
101
|
+
products[:solidus_tshirt].variants.each do |variant|
|
88
102
|
color = variant.option_value("tshirt-color").downcase
|
89
|
-
main_image = image("
|
103
|
+
main_image = image("solidus_tshirt_#{color}", "png")
|
90
104
|
File.open(main_image) do |f|
|
91
105
|
variant.images.create!(attachment: f)
|
92
106
|
end
|
93
|
-
back_image = image("
|
107
|
+
back_image = image("solidus_tshirt_back_#{color}", "png")
|
108
|
+
|
94
109
|
next unless back_image
|
110
|
+
|
95
111
|
File.open(back_image) do |f|
|
96
112
|
variant.images.create!(attachment: f)
|
97
113
|
end
|
98
114
|
end
|
99
115
|
|
116
|
+
products[:solidus_long].variants.each do |variant|
|
117
|
+
color = variant.option_value("tshirt-color").downcase
|
118
|
+
main_image = image("solidus_long_#{color}", "png")
|
119
|
+
File.open(main_image) do |f|
|
120
|
+
variant.images.create!(attachment: f)
|
121
|
+
end
|
122
|
+
back_image = image("solidus_long_back_#{color}", "png")
|
123
|
+
|
124
|
+
next unless back_image
|
125
|
+
|
126
|
+
File.open(back_image) do |f|
|
127
|
+
variant.images.create!(attachment: f)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
products[:solidus_girly].reload.variants.each do |variant|
|
132
|
+
color = variant.option_value("tshirt-color").downcase
|
133
|
+
main_image = image("solidus_girly_#{color}", "png")
|
134
|
+
File.open(main_image) do |f|
|
135
|
+
variant.images.create!(attachment: f)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
100
139
|
images.each do |variant, attachments|
|
101
140
|
puts "Loading images for #{variant.product.name}"
|
102
141
|
attachments.each do |attachment|
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/db/samples/option_values.rb
CHANGED
@@ -33,12 +33,24 @@ Spree::OptionValue.create!([
|
|
33
33
|
{
|
34
34
|
name: "Red",
|
35
35
|
presentation: "Red",
|
36
|
-
position:
|
36
|
+
position: 5,
|
37
37
|
option_type: color
|
38
38
|
},
|
39
39
|
{
|
40
40
|
name: "Green",
|
41
41
|
presentation: "Green",
|
42
|
+
position: 4,
|
43
|
+
option_type: color
|
44
|
+
},
|
45
|
+
{
|
46
|
+
name: "Black",
|
47
|
+
presentation: "Black",
|
48
|
+
position: 1,
|
49
|
+
option_type: color
|
50
|
+
},
|
51
|
+
{
|
52
|
+
name: "White",
|
53
|
+
presentation: "White",
|
42
54
|
position: 2,
|
43
55
|
option_type: color
|
44
56
|
},
|
data/db/samples/orders.rb
CHANGED
@@ -28,20 +28,20 @@ orders << Spree::Order.create!(
|
|
28
28
|
)
|
29
29
|
|
30
30
|
orders[0].line_items.create!(
|
31
|
-
variant: Spree::Product.find_by!(name: "
|
31
|
+
variant: Spree::Product.find_by!(name: "Solidus Tote").master,
|
32
32
|
quantity: 1,
|
33
33
|
price: 15.99
|
34
34
|
)
|
35
35
|
|
36
36
|
orders[1].line_items.create!(
|
37
|
-
variant: Spree::Product.find_by!(name: "
|
37
|
+
variant: Spree::Product.find_by!(name: "Solidus Snapback Cap").master,
|
38
38
|
quantity: 1,
|
39
39
|
price: 22.99
|
40
40
|
)
|
41
41
|
|
42
42
|
orders.each do |order|
|
43
43
|
order.payments.create!(payment_method: payment_method)
|
44
|
-
order.
|
44
|
+
order.update(store: store)
|
45
45
|
|
46
46
|
order.next! while !order.can_complete?
|
47
47
|
order.complete!
|
@@ -5,6 +5,6 @@ Spree::Sample.load_sample("products")
|
|
5
5
|
size = Spree::OptionType.find_by!(presentation: "Size")
|
6
6
|
color = Spree::OptionType.find_by!(presentation: "Color")
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
solidus_tshirt = Spree::Product.find_by!(name: "Solidus T-Shirt")
|
9
|
+
solidus_tshirt.option_types = [size, color]
|
10
|
+
solidus_tshirt.save!
|
@@ -2,60 +2,110 @@
|
|
2
2
|
|
3
3
|
products =
|
4
4
|
{
|
5
|
-
"
|
5
|
+
"Solidus Tote" =>
|
6
|
+
{
|
7
|
+
"Type" => "Tote",
|
8
|
+
"Size" => %{15" x 18" x 6"},
|
9
|
+
"Material" => "Canvas"
|
10
|
+
},
|
11
|
+
"Ruby Tote" =>
|
12
|
+
{
|
13
|
+
"Type" => "Tote",
|
14
|
+
"Size" => %{15" x 18" x 6"},
|
15
|
+
"Material" => "Canvas"
|
16
|
+
},
|
17
|
+
"Solidus Snapback Cap" =>
|
18
|
+
{
|
19
|
+
"Type" => "Snapback Cap",
|
20
|
+
"Size" => "One Size",
|
21
|
+
"Material" => "100% Cotton"
|
22
|
+
},
|
23
|
+
"Solidus T-Shirt" =>
|
24
|
+
{
|
25
|
+
"Manufacturer" => "Jerseys",
|
26
|
+
"Brand" => "Conditioned",
|
27
|
+
"Model" => "TL9002",
|
28
|
+
"Shirt Type" => "Ringer T",
|
29
|
+
"Sleeve Type" => "Short",
|
30
|
+
"Made from" => "100% Cotton",
|
31
|
+
"Fit" => "Loose",
|
32
|
+
"Gender" => "Men's"
|
33
|
+
},
|
34
|
+
"Solidus Long Sleeve" =>
|
6
35
|
{
|
7
36
|
"Manufacturer" => "Wilson",
|
8
37
|
"Brand" => "Wannabe Sports",
|
9
|
-
"Model" => "
|
10
|
-
"Shirt Type" => "
|
38
|
+
"Model" => "TL9002",
|
39
|
+
"Shirt Type" => "Jersey",
|
11
40
|
"Sleeve Type" => "Long",
|
12
41
|
"Made from" => "100% cotton",
|
13
42
|
"Fit" => "Loose",
|
14
43
|
"Gender" => "Men's"
|
15
44
|
},
|
16
|
-
"
|
45
|
+
"Solidus Hoodie Zip" =>
|
17
46
|
{
|
18
47
|
"Manufacturer" => "Jerseys",
|
48
|
+
"Brand" => "Wannabe Sports",
|
49
|
+
"Model" => "HD9001",
|
50
|
+
"Shirt Type" => "Jersey",
|
51
|
+
"Sleeve Type" => "Long",
|
52
|
+
"Made from" => "100% cotton",
|
53
|
+
"Fit" => "Loose",
|
54
|
+
"Gender" => "Unisex"
|
55
|
+
},
|
56
|
+
"Ruby Hoodie" =>
|
57
|
+
{
|
58
|
+
"Manufacturer" => "Wilson",
|
19
59
|
"Brand" => "Resiliance",
|
20
|
-
"Model" => "
|
21
|
-
"Shirt Type" => "
|
22
|
-
"Sleeve Type" => "
|
60
|
+
"Model" => "HD2001",
|
61
|
+
"Shirt Type" => "Baseball",
|
62
|
+
"Sleeve Type" => "Long",
|
23
63
|
"Made from" => "90% Cotton, 10% Nylon",
|
24
|
-
"Fit" => "
|
25
|
-
"Gender" => "
|
64
|
+
"Fit" => "Loose",
|
65
|
+
"Gender" => "Unisex"
|
26
66
|
},
|
27
|
-
"Ruby
|
67
|
+
"Ruby Hoodie Zip" =>
|
28
68
|
{
|
29
69
|
"Manufacturer" => "Jerseys",
|
30
|
-
"Brand" => "
|
31
|
-
"Model" => "
|
32
|
-
"Shirt Type" => "
|
33
|
-
"Sleeve Type" => "
|
34
|
-
"Made from" => "100%
|
70
|
+
"Brand" => "Wannabe Sports",
|
71
|
+
"Model" => "HD9001",
|
72
|
+
"Shirt Type" => "Jersey",
|
73
|
+
"Sleeve Type" => "Long",
|
74
|
+
"Made from" => "100% cotton",
|
35
75
|
"Fit" => "Loose",
|
36
|
-
"Gender" => "
|
76
|
+
"Gender" => "Unisex"
|
37
77
|
},
|
38
|
-
"Ruby
|
78
|
+
"Ruby Polo" =>
|
39
79
|
{
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
80
|
+
"Manufacturer" => "Wilson",
|
81
|
+
"Brand" => "Resiliance",
|
82
|
+
"Model" => "PL9001",
|
83
|
+
"Shirt Type" => "Ringer T",
|
84
|
+
"Sleeve Type" => "Short",
|
85
|
+
"Made from" => "100% Cotton",
|
86
|
+
"Fit" => "Slim",
|
87
|
+
"Gender" => "Men's"
|
43
88
|
},
|
44
|
-
"
|
89
|
+
"Solidus Mug" =>
|
45
90
|
{
|
46
|
-
"Type" => "
|
47
|
-
"Size" => %{
|
48
|
-
"Material" => "600 Denier Polyester"
|
91
|
+
"Type" => "Mug",
|
92
|
+
"Size" => %{4.5" tall, 3.25" dia.}
|
49
93
|
},
|
50
|
-
"Ruby
|
94
|
+
"Ruby Mug" =>
|
51
95
|
{
|
52
96
|
"Type" => "Mug",
|
53
97
|
"Size" => %{4.5" tall, 3.25" dia.}
|
54
98
|
},
|
55
|
-
"
|
99
|
+
"Solidus Girly" =>
|
56
100
|
{
|
57
|
-
"
|
58
|
-
"
|
101
|
+
"Manufacturer" => "Jerseys",
|
102
|
+
"Brand" => "Conditioned",
|
103
|
+
"Model" => "WM6001",
|
104
|
+
"Shirt Type" => "Skinny",
|
105
|
+
"Sleeve Type" => "Short",
|
106
|
+
"Made from" => "90% Cotton, 10% Nylon",
|
107
|
+
"Fit" => "Slim",
|
108
|
+
"Gender" => "Women's"
|
59
109
|
}
|
60
110
|
}
|
61
111
|
|