spree_sample 4.3.2 → 4.4.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/samples/menu_items.rb +11 -11
- data/db/samples/orders.rb +12 -10
- data/db/samples/payment_methods.rb +4 -2
- data/db/samples/payments.rb +2 -0
- data/db/samples/products.rb +2 -5
- data/db/samples/stock.rb +3 -1
- data/db/samples/taxons.rb +2 -2
- data/db/samples/variants.csv +6 -6
- data/db/samples.rb +0 -1
- data/lib/spree/sample.rb +1 -1
- data/lib/spree_sample.rb +0 -1
- metadata +9 -10
- data/db/samples/shipping_categories.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9537178abaa22f46afb930b540d8652a2620f8b3eb25ae51eb1d3ee2eae7cf57
|
4
|
+
data.tar.gz: 952503f53b0f1acc6fef907b7501c7b9e1b1fe19010389329bea5b9af833609e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1378fc7f8230dd976319ae551c7df687f8a95186a55f371516fb005309769694513cc2c2e43521e528fc8183d615cc7ce6408bcc6b85ea5946b33d24d0a188aa
|
7
|
+
data.tar.gz: f2db8b93a0b9c7bdf10335f97091049e9208a3ce65fc594046ffc103fbab56f53b4114453318dba826238d298f3d55dfa6d0ea75bf80fe8af8425992e94682df
|
data/db/samples/menu_items.rb
CHANGED
@@ -14,7 +14,7 @@ MENUS.each do |menu|
|
|
14
14
|
root_name_b = 'Men'
|
15
15
|
root_name_c = 'Sportswear'
|
16
16
|
|
17
|
-
|
17
|
+
categories = 'Categories'
|
18
18
|
|
19
19
|
skirts = 'Skirts'
|
20
20
|
dresses = 'Dresses'
|
@@ -39,7 +39,7 @@ MENUS.each do |menu|
|
|
39
39
|
root_name_b = 'Hommes'
|
40
40
|
root_name_c = 'Tenue de sport'
|
41
41
|
|
42
|
-
|
42
|
+
categories = 'Catégories'
|
43
43
|
|
44
44
|
skirts = 'Jupes'
|
45
45
|
dresses = 'Robes'
|
@@ -64,7 +64,7 @@ MENUS.each do |menu|
|
|
64
64
|
root_name_b = 'Männer'
|
65
65
|
root_name_c = 'Sportbekleidung'
|
66
66
|
|
67
|
-
|
67
|
+
categories = 'Kategorien'
|
68
68
|
|
69
69
|
skirts = 'die Röcke'
|
70
70
|
dresses = 'Kleider'
|
@@ -89,7 +89,7 @@ MENUS.each do |menu|
|
|
89
89
|
root_name_b = 'Mujeres'
|
90
90
|
root_name_c = 'Ropa de deporte'
|
91
91
|
|
92
|
-
|
92
|
+
categories = 'Categorías'
|
93
93
|
|
94
94
|
skirts = 'Faldas'
|
95
95
|
dresses = 'Vestidos'
|
@@ -152,7 +152,7 @@ MENUS.each do |menu|
|
|
152
152
|
# Categories #
|
153
153
|
##############
|
154
154
|
menu_cat_women = Spree::MenuItem.where(
|
155
|
-
name:
|
155
|
+
name: categories,
|
156
156
|
item_type: 'Container',
|
157
157
|
code: 'category',
|
158
158
|
menu_id: menu,
|
@@ -160,7 +160,7 @@ MENUS.each do |menu|
|
|
160
160
|
).first_or_create!
|
161
161
|
|
162
162
|
menu_cat_men = Spree::MenuItem.where(
|
163
|
-
name:
|
163
|
+
name: categories,
|
164
164
|
item_type: 'Container',
|
165
165
|
code: 'category',
|
166
166
|
menu_id: menu,
|
@@ -168,7 +168,7 @@ MENUS.each do |menu|
|
|
168
168
|
).first_or_create!
|
169
169
|
|
170
170
|
menu_cat_sw = Spree::MenuItem.where(
|
171
|
-
name:
|
171
|
+
name: categories,
|
172
172
|
item_type: 'Container',
|
173
173
|
code: 'category',
|
174
174
|
menu_id: menu,
|
@@ -207,7 +207,7 @@ MENUS.each do |menu|
|
|
207
207
|
promos = []
|
208
208
|
end
|
209
209
|
|
210
|
-
summer = Spree::Taxon.find_by!(permalink:
|
210
|
+
summer = Spree::Taxon.find_by!(permalink: 'categories/new-collection/summer-2021')
|
211
211
|
offers = Spree::Taxon.find_by!(permalink: 'categories/special-offers/30-percent-off')
|
212
212
|
|
213
213
|
#####################
|
@@ -239,7 +239,7 @@ MENUS.each do |menu|
|
|
239
239
|
end
|
240
240
|
|
241
241
|
#################################
|
242
|
-
# Links For: WOMEN /
|
242
|
+
# Links For: WOMEN / CATEGORIES #
|
243
243
|
#################################
|
244
244
|
|
245
245
|
women_link_parent_id = if menu.location == 'header'
|
@@ -315,7 +315,7 @@ MENUS.each do |menu|
|
|
315
315
|
women_j_c.save!
|
316
316
|
|
317
317
|
###############################
|
318
|
-
# Links For: MEN /
|
318
|
+
# Links For: MEN / CATEGORIES #
|
319
319
|
###############################
|
320
320
|
|
321
321
|
men_link_parent_id = if menu.location == 'header'
|
@@ -369,7 +369,7 @@ MENUS.each do |menu|
|
|
369
369
|
men_j_c.save!
|
370
370
|
|
371
371
|
######################################
|
372
|
-
# Links For: SPORTSWARE /
|
372
|
+
# Links For: SPORTSWARE / CATEGORIES #
|
373
373
|
######################################
|
374
374
|
|
375
375
|
sw_link_parent_id = if menu.location == 'header'
|
data/db/samples/orders.rb
CHANGED
@@ -7,20 +7,22 @@ product_2 = Spree::Product.find_by!(name: 'Checked Shirt')
|
|
7
7
|
orders = []
|
8
8
|
orders << Spree::Order.where(
|
9
9
|
number: 'R123456789',
|
10
|
-
email: 'spree@example.com'
|
10
|
+
email: 'spree@example.com',
|
11
|
+
currency: 'USD'
|
11
12
|
).first_or_create! do |order|
|
12
|
-
order.item_total = product_1.master.
|
13
|
-
order.adjustment_total = product_1.master.
|
14
|
-
order.total = product_1.master.
|
13
|
+
order.item_total = product_1.master.amount_in(order.currency)
|
14
|
+
order.adjustment_total = product_1.master.amount_in(order.currency)
|
15
|
+
order.total = product_1.master.amount_in(order.currency) * 2
|
15
16
|
end
|
16
17
|
|
17
18
|
orders << Spree::Order.where(
|
18
19
|
number: 'R987654321',
|
19
|
-
email: 'spree@example.com'
|
20
|
+
email: 'spree@example.com',
|
21
|
+
currency: 'USD'
|
20
22
|
).first_or_create! do |order|
|
21
|
-
order.item_total = product_2.master.
|
22
|
-
order.adjustment_total = product_2.master.
|
23
|
-
order.total = product_2.master.
|
23
|
+
order.item_total = product_2.master.amount_in(order.currency)
|
24
|
+
order.adjustment_total = product_2.master.amount_in(order.currency)
|
25
|
+
order.total = product_2.master.amount_in(order.currency) * 2
|
24
26
|
order.shipping_address = Spree::Address.first
|
25
27
|
order.billing_address = Spree::Address.last
|
26
28
|
end
|
@@ -29,7 +31,7 @@ unless orders[0].line_items.any?
|
|
29
31
|
orders[0].line_items.new(
|
30
32
|
variant: product_1.master,
|
31
33
|
quantity: 1,
|
32
|
-
price: product_1.master.
|
34
|
+
price: product_1.master.amount_in(orders[0].currency)
|
33
35
|
).save!
|
34
36
|
end
|
35
37
|
|
@@ -37,7 +39,7 @@ unless orders[1].line_items.any?
|
|
37
39
|
orders[1].line_items.new(
|
38
40
|
variant: product_2.master,
|
39
41
|
quantity: 1,
|
40
|
-
price: product_1.master.
|
42
|
+
price: product_1.master.amount_in(orders[1].currency)
|
41
43
|
).save!
|
42
44
|
end
|
43
45
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
Spree::Sample.load_sample('stores')
|
2
|
+
|
1
3
|
cc_payment_method = Spree::Gateway::Bogus.where(
|
2
4
|
name: 'Credit Card',
|
3
5
|
description: 'Bogus payment gateway.',
|
@@ -5,7 +7,7 @@ cc_payment_method = Spree::Gateway::Bogus.where(
|
|
5
7
|
).first_or_initialize
|
6
8
|
|
7
9
|
cc_payment_method.stores = Spree::Store.all
|
8
|
-
cc_payment_method.save
|
10
|
+
cc_payment_method.save!
|
9
11
|
|
10
12
|
check_paymemt_method = Spree::PaymentMethod::Check.where(
|
11
13
|
name: 'Check',
|
@@ -14,4 +16,4 @@ check_paymemt_method = Spree::PaymentMethod::Check.where(
|
|
14
16
|
).first_or_initialize
|
15
17
|
|
16
18
|
check_paymemt_method.stores = Spree::Store.all
|
17
|
-
check_paymemt_method.save
|
19
|
+
check_paymemt_method.save!
|
data/db/samples/payments.rb
CHANGED
data/db/samples/products.rb
CHANGED
@@ -1,15 +1,12 @@
|
|
1
1
|
require 'csv'
|
2
2
|
|
3
3
|
Spree::Sample.load_sample('tax_categories')
|
4
|
-
Spree::Sample.load_sample('shipping_categories')
|
5
4
|
Spree::Sample.load_sample('option_types')
|
6
5
|
Spree::Sample.load_sample('taxons')
|
7
6
|
Spree::Sample.load_sample('stores')
|
8
7
|
|
9
|
-
default_shipping_category = Spree::ShippingCategory.
|
10
|
-
clothing_tax_category = Spree::TaxCategory.
|
11
|
-
|
12
|
-
Spree::Config[:currency] = 'USD'
|
8
|
+
default_shipping_category = Spree::ShippingCategory.find_or_create_by!(name: 'Default')
|
9
|
+
clothing_tax_category = Spree::TaxCategory.find_or_create_by!(name: 'Clothing')
|
13
10
|
|
14
11
|
color = Spree::OptionType.find_by!(name: 'color')
|
15
12
|
length = Spree::OptionType.find_by!(name: 'length')
|
data/db/samples/stock.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Spree::Sample.load_sample('variants')
|
2
2
|
|
3
3
|
country = Spree::Country.find_by(iso: 'US')
|
4
|
-
location = Spree::StockLocation.find_or_create_by!(name: 'default')
|
4
|
+
location = Spree::StockLocation.find_or_create_by!(name: 'default', propagate_all_variants: false)
|
5
5
|
location.update(
|
6
6
|
address1: 'Example Street',
|
7
7
|
city: 'City',
|
@@ -11,6 +11,8 @@ location.update(
|
|
11
11
|
active: true
|
12
12
|
)
|
13
13
|
|
14
|
+
Spree::StockLocations::StockItems::Create.call(stock_location: location)
|
15
|
+
|
14
16
|
product_1 = Spree::Product.find_by!(name: 'Denim Shirt')
|
15
17
|
product_2 = Spree::Product.find_by!(name: 'Checked Shirt')
|
16
18
|
|
data/db/samples/taxons.rb
CHANGED
@@ -4,7 +4,7 @@ Spree::Sample.load_sample('taxonomies')
|
|
4
4
|
|
5
5
|
ADDITIONAL_TAXONS = ['Bestsellers', 'Trending', 'Streetstyle', 'Summer Sale'].freeze
|
6
6
|
|
7
|
-
SPECIAL_TAXONS = { 'New Collection':
|
7
|
+
SPECIAL_TAXONS = { 'New Collection': 'Summer 2021', 'Special Offers': '30% Off' }.freeze
|
8
8
|
|
9
9
|
CHILDREN_TAXON_NAMES = CSV.read(File.join(__dir__, 'variants.csv')).map do |(parent_name, taxon_name, _product_name, _color_name)|
|
10
10
|
[parent_name, taxon_name]
|
@@ -28,7 +28,7 @@ CHILDREN_TAXON_NAMES.each do |(parent_name, taxon_name)|
|
|
28
28
|
taxon.save!
|
29
29
|
end
|
30
30
|
|
31
|
-
taxon = categories_taxon.children.where(name: 'New'
|
31
|
+
taxon = categories_taxon.children.where(name: 'New').first_or_create!
|
32
32
|
taxon.taxonomy = categories
|
33
33
|
taxon.save!
|
34
34
|
|
data/db/samples/variants.csv
CHANGED
@@ -115,10 +115,10 @@ Women,Shirts and Blouses,semi-sheer shirt with pockets,white
|
|
115
115
|
Women,Shirts and Blouses,v-neck shirt,pink
|
116
116
|
Women,Shirts and Blouses,v-neck shirt,white
|
117
117
|
Women,Shirts and Blouses,printed shirt,green
|
118
|
-
Women,Sweaters,
|
119
|
-
Women,Sweaters,
|
120
|
-
Women,Sweaters,
|
121
|
-
Women,Sweaters,
|
118
|
+
Women,Sweaters,asymmetric sweater with wide sleeves,blue
|
119
|
+
Women,Sweaters,asymmetric sweater with wide sleeves,grey
|
120
|
+
Women,Sweaters,asymmetric sweater with wide sleeves,red
|
121
|
+
Women,Sweaters,asymmetric sweater with wide sleeves,white
|
122
122
|
Women,Sweaters,oversized knitted sweater,red
|
123
123
|
Women,Sweaters,oversized sweatshirt,brown
|
124
124
|
Women,Sweaters,knitted high neck sweater,blue
|
@@ -152,7 +152,7 @@ Women,Jackets and Coats,coat with pockets,burgundy
|
|
152
152
|
Women,Jackets and Coats,coat with pockets,black
|
153
153
|
Women,Jackets and Coats,long wool-blend coat with belt,dark_blue
|
154
154
|
Women,Jackets and Coats,long wool-blend coat with belt,beige
|
155
|
-
Women,Jackets and Coats,
|
155
|
+
Women,Jackets and Coats,asymmetric coat,white
|
156
156
|
Women,Jackets and Coats,long coat with belt,beige
|
157
157
|
Women,Jackets and Coats,down jacket,white
|
158
158
|
Women,Jackets and Coats,zipped jacket,blue
|
@@ -177,7 +177,7 @@ Sportswear,Tops,sports bra ,blue
|
|
177
177
|
Sportswear,Tops,sports bra ,burgundy
|
178
178
|
Sportswear,Tops,sport cropp top,burgundy
|
179
179
|
Sportswear,Sweatshirts,running sweatshirt,light_blue
|
180
|
-
Sportswear,Sweatshirts,
|
180
|
+
Sportswear,Sweatshirts,lightweight running jacket,grey
|
181
181
|
Sportswear,Sweatshirts,oversize sweatshirt,pink
|
182
182
|
Sportswear,Sweatshirts,sport windproof jacket,blue
|
183
183
|
Sportswear,Sweatshirts,sport waistcoat,purple
|
data/db/samples.rb
CHANGED
data/lib/spree/sample.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Spree
|
2
2
|
module Sample
|
3
3
|
def self.load_sample(file)
|
4
|
-
# If file exists within application it takes
|
4
|
+
# If file exists within application it takes precedence.
|
5
5
|
path = if File.exist?(File.join(Rails.root, 'db', 'samples', "#{file}.rb"))
|
6
6
|
File.expand_path(File.join(Rails.root, 'db', 'samples', "#{file}.rb"))
|
7
7
|
else
|
data/lib/spree_sample.rb
CHANGED
@@ -10,7 +10,6 @@ module SpreeSample
|
|
10
10
|
Spree::Sample.load_sample('addresses')
|
11
11
|
Spree::Sample.load_sample('zones')
|
12
12
|
Spree::Sample.load_sample('payment_methods')
|
13
|
-
Spree::Sample.load_sample('shipping_categories')
|
14
13
|
Spree::Sample.load_sample('shipping_methods')
|
15
14
|
Spree::Sample.load_sample('tax_categories')
|
16
15
|
Spree::Sample.load_sample('tax_rates')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_sample
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spree_core
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 4.
|
20
|
+
version: 4.4.0.rc1
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 4.
|
27
|
+
version: 4.4.0.rc1
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: ffaker
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,7 +102,6 @@ files:
|
|
102
102
|
- db/samples/prototypes.rb
|
103
103
|
- db/samples/reimbursements.rb
|
104
104
|
- db/samples/return_authorization_reasons.rb
|
105
|
-
- db/samples/shipping_categories.rb
|
106
105
|
- db/samples/shipping_methods.rb
|
107
106
|
- db/samples/stock.rb
|
108
107
|
- db/samples/stores.rb
|
@@ -122,9 +121,9 @@ licenses:
|
|
122
121
|
- BSD-3-Clause
|
123
122
|
metadata:
|
124
123
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
125
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v4.
|
124
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.4.0.rc1
|
126
125
|
documentation_uri: https://dev-docs.spreecommerce.org/
|
127
|
-
source_code_uri: https://github.com/spree/spree/tree/v4.
|
126
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.4.0.rc1
|
128
127
|
post_install_message:
|
129
128
|
rdoc_options: []
|
130
129
|
require_paths:
|
@@ -136,12 +135,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
136
135
|
version: '0'
|
137
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
137
|
requirements:
|
139
|
-
- - "
|
138
|
+
- - ">"
|
140
139
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
140
|
+
version: 1.3.1
|
142
141
|
requirements:
|
143
142
|
- none
|
144
|
-
rubygems_version: 3.
|
143
|
+
rubygems_version: 3.2.22
|
145
144
|
signing_key:
|
146
145
|
specification_version: 4
|
147
146
|
summary: Sample data for Spree Commerce
|
@@ -1 +0,0 @@
|
|
1
|
-
Spree::ShippingCategory.find_or_create_by!(name: 'Default')
|