solidus_sample 4.3.5 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/samples/orders.rb +2 -2
- data/db/samples/product_option_types.rb +13 -8
- data/db/samples/product_properties.rb +1 -1
- data/db/samples/products.rb +24 -24
- data/db/samples/reimbursements.rb +4 -4
- data/db/samples/shipping_methods.rb +6 -6
- data/db/samples/stock.rb +2 -2
- data/db/samples/tax_rates.rb +1 -1
- data/db/samples/taxons.rb +1 -1
- data/solidus_sample.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c345bdffb3ee83363653ada0a07169920faed11b47f55e651cf78c9d677e1393
|
4
|
+
data.tar.gz: 39d4e99f6d244cdfea08897b0a66ab62d692bfdfd30b99ebaba0f1b1c99cc0bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c93cca1926f8a241e67da554cec2603654b6b68bc592081b0b1708335a5d643990dc9cc78fda87f7fc28e4fc06c6ffbba290b88cd82a66c55fb449bd6faa2af
|
7
|
+
data.tar.gz: 3c125d9dc134ed4ab213357d928529dba3b4d363e006081fbb7e5f576ac218d60752981244ac3108e91c067edb53d9db466ec12d3ea7002c1b45b393e9ff9902
|
data/db/samples/orders.rb
CHANGED
@@ -41,8 +41,8 @@ orders[1].line_items.create!(
|
|
41
41
|
)
|
42
42
|
|
43
43
|
orders.each do |order|
|
44
|
-
order.payments.create!(payment_method:
|
45
|
-
order.update(store:
|
44
|
+
order.payments.create!(payment_method:)
|
45
|
+
order.update(store:)
|
46
46
|
|
47
47
|
order.next! while !order.can_complete?
|
48
48
|
order.complete!
|
@@ -5,12 +5,17 @@ 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
|
-
|
8
|
+
products_with_variants = [
|
9
|
+
"Solidus cap",
|
10
|
+
"Solidus hoodie",
|
11
|
+
"Solidus t-shirt",
|
12
|
+
"Solidus mug set",
|
13
|
+
"Solidus tote",
|
14
|
+
"Solidus Water Bottle"
|
15
|
+
]
|
9
16
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
solidus_hoodie.option_types = [size, color]
|
16
|
-
solidus_hoodie.save!
|
17
|
+
products_with_variants.each do |name|
|
18
|
+
product = Spree::Product.find_by!(name:)
|
19
|
+
product.option_types = [size, color]
|
20
|
+
product.save!
|
21
|
+
end
|
data/db/samples/products.rb
CHANGED
@@ -23,8 +23,8 @@ default_attrs = {
|
|
23
23
|
products = [
|
24
24
|
{
|
25
25
|
name: "Solidus Water Bottle",
|
26
|
-
tax_category
|
27
|
-
shipping_category
|
26
|
+
tax_category:,
|
27
|
+
shipping_category:,
|
28
28
|
price: 19.99,
|
29
29
|
eur_price: 16,
|
30
30
|
weight: 0.5,
|
@@ -34,8 +34,8 @@ products = [
|
|
34
34
|
},
|
35
35
|
{
|
36
36
|
name: "Solidus tote",
|
37
|
-
tax_category
|
38
|
-
shipping_category
|
37
|
+
tax_category:,
|
38
|
+
shipping_category:,
|
39
39
|
price: 19.99,
|
40
40
|
eur_price: 16,
|
41
41
|
weight: 0.5,
|
@@ -45,8 +45,8 @@ products = [
|
|
45
45
|
},
|
46
46
|
{
|
47
47
|
name: "Solidus hoodie",
|
48
|
-
tax_category
|
49
|
-
shipping_category
|
48
|
+
tax_category:,
|
49
|
+
shipping_category:,
|
50
50
|
price: 29.99,
|
51
51
|
eur_price: 27,
|
52
52
|
weight: 1,
|
@@ -56,8 +56,8 @@ products = [
|
|
56
56
|
},
|
57
57
|
{
|
58
58
|
name: "Solidus mug set",
|
59
|
-
tax_category
|
60
|
-
shipping_category
|
59
|
+
tax_category:,
|
60
|
+
shipping_category:,
|
61
61
|
price: 19.99,
|
62
62
|
eur_price: 16,
|
63
63
|
weight: 0.5,
|
@@ -67,8 +67,8 @@ products = [
|
|
67
67
|
},
|
68
68
|
{
|
69
69
|
name: "Solidus winter hat",
|
70
|
-
tax_category
|
71
|
-
shipping_category
|
70
|
+
tax_category:,
|
71
|
+
shipping_category:,
|
72
72
|
price: 29.99,
|
73
73
|
eur_price: 27,
|
74
74
|
weight: 1,
|
@@ -78,8 +78,8 @@ products = [
|
|
78
78
|
},
|
79
79
|
{
|
80
80
|
name: "Solidus circle sticker",
|
81
|
-
tax_category
|
82
|
-
shipping_category
|
81
|
+
tax_category:,
|
82
|
+
shipping_category:,
|
83
83
|
price: 29.99,
|
84
84
|
eur_price: 27,
|
85
85
|
weight: 0.8,
|
@@ -89,8 +89,8 @@ products = [
|
|
89
89
|
},
|
90
90
|
{
|
91
91
|
name: "Solidus notebook",
|
92
|
-
tax_category
|
93
|
-
shipping_category
|
92
|
+
tax_category:,
|
93
|
+
shipping_category:,
|
94
94
|
price: 26.99,
|
95
95
|
eur_price: 23,
|
96
96
|
weight: 0.5,
|
@@ -100,8 +100,8 @@ products = [
|
|
100
100
|
},
|
101
101
|
{
|
102
102
|
name: "Solidus t-shirt",
|
103
|
-
tax_category
|
104
|
-
shipping_category
|
103
|
+
tax_category:,
|
104
|
+
shipping_category:,
|
105
105
|
price: 9.99,
|
106
106
|
eur_price: 7,
|
107
107
|
weight: 1,
|
@@ -111,8 +111,8 @@ products = [
|
|
111
111
|
},
|
112
112
|
{
|
113
113
|
name: "Solidus long sleeve tee",
|
114
|
-
tax_category
|
115
|
-
shipping_category
|
114
|
+
tax_category:,
|
115
|
+
shipping_category:,
|
116
116
|
price: 15.99,
|
117
117
|
eur_price: 14,
|
118
118
|
weight: 0.5,
|
@@ -122,8 +122,8 @@ products = [
|
|
122
122
|
},
|
123
123
|
{
|
124
124
|
name: "Solidus dark tee",
|
125
|
-
tax_category
|
126
|
-
shipping_category
|
125
|
+
tax_category:,
|
126
|
+
shipping_category:,
|
127
127
|
price: 15.99,
|
128
128
|
eur_price: 14,
|
129
129
|
weight: 0.5,
|
@@ -133,8 +133,8 @@ products = [
|
|
133
133
|
},
|
134
134
|
{
|
135
135
|
name: "Solidus canvas tote bag",
|
136
|
-
tax_category
|
137
|
-
shipping_category
|
136
|
+
tax_category:,
|
137
|
+
shipping_category:,
|
138
138
|
price: 15.99,
|
139
139
|
eur_price: 14,
|
140
140
|
weight: 0.5,
|
@@ -145,8 +145,8 @@ products = [
|
|
145
145
|
{
|
146
146
|
name: "Solidus cap",
|
147
147
|
description: "Step into style with our signature cap – a perfect blend of comfort and trendsetting flair. Crafted with care and designed for the fashion-forward, this cap adds an instant touch of cool to any outfit. Whether you're hitting the streets or simply seeking shade, our cap is your go-to accessory. Elevate your look today!",
|
148
|
-
tax_category
|
149
|
-
shipping_category
|
148
|
+
tax_category:,
|
149
|
+
shipping_category:,
|
150
150
|
price: 24,
|
151
151
|
eur_price: 22,
|
152
152
|
weight: 0.5,
|
@@ -22,20 +22,20 @@ end
|
|
22
22
|
|
23
23
|
# Create a return authorization
|
24
24
|
return_item = Spree::ReturnItem.new(
|
25
|
-
inventory_unit
|
26
|
-
preferred_reimbursement_type:
|
25
|
+
inventory_unit:,
|
26
|
+
preferred_reimbursement_type:
|
27
27
|
)
|
28
28
|
|
29
29
|
order.return_authorizations.create!(
|
30
30
|
reason: return_reason,
|
31
31
|
return_items: [return_item],
|
32
|
-
stock_location:
|
32
|
+
stock_location:
|
33
33
|
)
|
34
34
|
|
35
35
|
# Create a customer return and mark it as received
|
36
36
|
customer_return = Spree::CustomerReturn.create!(
|
37
37
|
return_items: [return_item],
|
38
|
-
stock_location:
|
38
|
+
stock_location:
|
39
39
|
)
|
40
40
|
return_item.reload
|
41
41
|
return_item.receive!
|
@@ -17,35 +17,35 @@ Spree::ShippingMethod.create!([
|
|
17
17
|
name: "UPS Ground (USD)",
|
18
18
|
zones: [north_america],
|
19
19
|
calculator: Spree::Calculator::Shipping::FlatRate.create!,
|
20
|
-
tax_category
|
20
|
+
tax_category:,
|
21
21
|
shipping_categories: [shipping_category]
|
22
22
|
},
|
23
23
|
{
|
24
24
|
name: "UPS Two Day (USD)",
|
25
25
|
zones: [north_america],
|
26
26
|
calculator: Spree::Calculator::Shipping::FlatRate.create!,
|
27
|
-
tax_category
|
27
|
+
tax_category:,
|
28
28
|
shipping_categories: [shipping_category]
|
29
29
|
},
|
30
30
|
{
|
31
31
|
name: "UPS One Day (USD)",
|
32
32
|
zones: [north_america],
|
33
33
|
calculator: Spree::Calculator::Shipping::FlatRate.create!,
|
34
|
-
tax_category
|
34
|
+
tax_category:,
|
35
35
|
shipping_categories: [shipping_category]
|
36
36
|
},
|
37
37
|
{
|
38
38
|
name: "UPS Ground (EU)",
|
39
39
|
zones: [europe_vat],
|
40
40
|
calculator: Spree::Calculator::Shipping::FlatRate.create!,
|
41
|
-
tax_category
|
41
|
+
tax_category:,
|
42
42
|
shipping_categories: [shipping_category]
|
43
43
|
},
|
44
44
|
{
|
45
45
|
name: "UPS Ground (EUR)",
|
46
46
|
zones: [europe_vat],
|
47
47
|
calculator: Spree::Calculator::Shipping::FlatRate.create!,
|
48
|
-
tax_category
|
48
|
+
tax_category:,
|
49
49
|
shipping_categories: [shipping_category]
|
50
50
|
}
|
51
51
|
])
|
@@ -60,7 +60,7 @@ Spree::ShippingMethod.create!([
|
|
60
60
|
shipping_method = Spree::ShippingMethod.find_by!(name: shipping_method_name)
|
61
61
|
shipping_method.calculator.preferences = {
|
62
62
|
amount: price,
|
63
|
-
currency:
|
63
|
+
currency:
|
64
64
|
}
|
65
65
|
shipping_method.calculator.save!
|
66
66
|
shipping_method.save!
|
data/db/samples/stock.rb
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
Spree::Sample.load_sample("variants")
|
4
4
|
|
5
5
|
country = Spree::Country.find_by(iso: 'US')
|
6
|
-
location = Spree::StockLocation.first_or_create! name: 'default', address1: 'Example Street', city: 'City', zipcode: '12345', country
|
6
|
+
location = Spree::StockLocation.first_or_create! name: 'default', address1: 'Example Street', city: 'City', zipcode: '12345', country:, state: country.states.first
|
7
7
|
location.active = true
|
8
8
|
location.save!
|
9
9
|
|
10
10
|
Spree::Variant.all.find_each do |variant|
|
11
11
|
variant.stock_items.each do |stock_item|
|
12
|
-
Spree::StockMovement.create(quantity: 10, stock_item:
|
12
|
+
Spree::StockMovement.create(quantity: 10, stock_item:)
|
13
13
|
end
|
14
14
|
end
|
data/db/samples/tax_rates.rb
CHANGED
data/db/samples/taxons.rb
CHANGED
data/solidus_sample.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_sample
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
19
|
+
version: 4.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.
|
26
|
+
version: 4.4.0
|
27
27
|
description: Sample data (including images) for use with Solidus.
|
28
28
|
email: contact@solidus.io
|
29
29
|
executables: []
|
@@ -95,14 +95,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
95
95
|
requirements:
|
96
96
|
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: 3.
|
98
|
+
version: 3.1.0
|
99
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: 1.8.23
|
104
104
|
requirements: []
|
105
|
-
rubygems_version: 3.5.
|
105
|
+
rubygems_version: 3.5.22
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: Sample data (including images) for use with Solidus.
|