dup_spree_sample 1.3.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/LICENSE +26 -0
  2. data/db/sample/spree/addresses.yml +27 -0
  3. data/db/sample/spree/adjustments.yml +26 -0
  4. data/db/sample/spree/assets.yml +440 -0
  5. data/db/sample/spree/calculators.yml +26 -0
  6. data/db/sample/spree/inventory_units.rb +4 -0
  7. data/db/sample/spree/line_items.yml +40 -0
  8. data/db/sample/spree/option_types.yml +8 -0
  9. data/db/sample/spree/option_values.yml +35 -0
  10. data/db/sample/spree/orders.yml +20 -0
  11. data/db/sample/spree/payment_methods.yml +29 -0
  12. data/db/sample/spree/payments.rb +29 -0
  13. data/db/sample/spree/preferences.rb +21 -0
  14. data/db/sample/spree/prices.yml +224 -0
  15. data/db/sample/spree/product_option_types.yml +16 -0
  16. data/db/sample/spree/product_properties.yml +264 -0
  17. data/db/sample/spree/products.rb +15 -0
  18. data/db/sample/spree/products.yml +108 -0
  19. data/db/sample/spree/products/apache_baseball.png +0 -0
  20. data/db/sample/spree/products/ror_bag.jpeg +0 -0
  21. data/db/sample/spree/products/ror_baseball.jpeg +0 -0
  22. data/db/sample/spree/products/ror_baseball_back.jpeg +0 -0
  23. data/db/sample/spree/products/ror_baseball_jersey_back_blue.png +0 -0
  24. data/db/sample/spree/products/ror_baseball_jersey_back_green.png +0 -0
  25. data/db/sample/spree/products/ror_baseball_jersey_back_red.png +0 -0
  26. data/db/sample/spree/products/ror_baseball_jersey_blue.png +0 -0
  27. data/db/sample/spree/products/ror_baseball_jersey_green.png +0 -0
  28. data/db/sample/spree/products/ror_baseball_jersey_red.png +0 -0
  29. data/db/sample/spree/products/ror_jr_spaghetti.jpeg +0 -0
  30. data/db/sample/spree/products/ror_mug.jpeg +0 -0
  31. data/db/sample/spree/products/ror_mug_back.jpeg +0 -0
  32. data/db/sample/spree/products/ror_ringer.jpeg +0 -0
  33. data/db/sample/spree/products/ror_ringer_back.jpeg +0 -0
  34. data/db/sample/spree/products/ror_stein.jpeg +0 -0
  35. data/db/sample/spree/products/ror_stein_back.jpeg +0 -0
  36. data/db/sample/spree/products/ror_tote.jpeg +0 -0
  37. data/db/sample/spree/products/ror_tote_back.jpeg +0 -0
  38. data/db/sample/spree/products/ruby_baseball.png +0 -0
  39. data/db/sample/spree/products/spree_bag.jpeg +0 -0
  40. data/db/sample/spree/products/spree_jersey.jpeg +0 -0
  41. data/db/sample/spree/products/spree_jersey_back.jpeg +0 -0
  42. data/db/sample/spree/products/spree_mug.jpeg +0 -0
  43. data/db/sample/spree/products/spree_mug_back.jpeg +0 -0
  44. data/db/sample/spree/products/spree_ringer_t.jpeg +0 -0
  45. data/db/sample/spree/products/spree_ringer_t_back.jpeg +0 -0
  46. data/db/sample/spree/products/spree_spaghetti.jpeg +0 -0
  47. data/db/sample/spree/products/spree_stein.jpeg +0 -0
  48. data/db/sample/spree/products/spree_stein_back.jpeg +0 -0
  49. data/db/sample/spree/products/spree_tote_back.jpeg +0 -0
  50. data/db/sample/spree/products/spree_tote_front.jpeg +0 -0
  51. data/db/sample/spree/properties.yml +39 -0
  52. data/db/sample/spree/prototypes.yml +9 -0
  53. data/db/sample/spree/shipments.yml +8 -0
  54. data/db/sample/spree/shipping_categories.yml +2 -0
  55. data/db/sample/spree/shipping_methods.yml +12 -0
  56. data/db/sample/spree/tax_categories.yml +6 -0
  57. data/db/sample/spree/tax_rates.yml +4 -0
  58. data/db/sample/spree/taxonomies.yml +4 -0
  59. data/db/sample/spree/taxons.rb +3 -0
  60. data/db/sample/spree/taxons.yml +100 -0
  61. data/db/sample/spree/variants.yml +174 -0
  62. data/lib/spree_sample.rb +7 -0
  63. data/lib/tasks/sample.rake +11 -0
  64. metadata +125 -0
@@ -0,0 +1,26 @@
1
+ ups_ground_usd:
2
+ calculable: ups_ground_usd
3
+ calculable_type: Spree::ShippingMethod
4
+ type: Spree::Calculator::FlatRate
5
+ ups_two_day_usd:
6
+ calculable: ups_two_day_usd
7
+ calculable_type: Spree::ShippingMethod
8
+ type: Spree::Calculator::FlatRate
9
+ ups_one_day_usd:
10
+ calculable: ups_one_day_usd
11
+ calculable_type: Spree::ShippingMethod
12
+ type: Spree::Calculator::FlatRate
13
+ ups_ground_eur:
14
+ calculable: ups_ground_eur
15
+ calculable_type: Spree::ShippingMethod
16
+ type: Spree::Calculator::FlatRate
17
+ flat_rate_coupon_calculator:
18
+ calculable: spree_coupon
19
+ calculable_type: Spree::Promotion
20
+ type: Spree::Calculator::FlatRate
21
+ tax_rate_calculator:
22
+ calculable: tax_rate_north_america
23
+ calculable_type: Spree::TaxRate
24
+ type: Spree::Calculator::DefaultTax
25
+
26
+
@@ -0,0 +1,4 @@
1
+ # create the inventory units associated with the line item (we need to do this after the fixture b/c quantity is random)
2
+ Spree::LineItem.all.each do |li|
3
+ li.quantity.times { li.order.inventory_units.create({:variant => li.variant, :state => 'sold', :shipment => li.order.shipment}, :without_protection => true) }
4
+ end
@@ -0,0 +1,40 @@
1
+ <% for i in 1..100 do%>
2
+ li_<%= i %>:
3
+ order: order_<%= i %>
4
+ variant: ror_tote_v
5
+ quantity: <%= rand(4) + 1 %>
6
+ price: 15.99
7
+ <% end %>
8
+
9
+ <% for i in 1..10 do%>
10
+ li_<%= i + 1000 %>:
11
+ order: order_<%= i %>
12
+ variant: ror_bag_v
13
+ quantity: <%= rand(2) + 1 %>
14
+ price: 22.99
15
+ <% end %>
16
+
17
+ <% for i in 10..20 do%>
18
+ li_<%= i + 2000 %>:
19
+ order: order_<%= i %>
20
+ variant: large-blue-baseball
21
+ quantity: <%= rand(3) + 1 %>
22
+ price: 19.99
23
+ <% end %>
24
+
25
+ <% for i in 10..30 do%>
26
+ li_<%= i + 3000 %>:
27
+ order: order_<%= i %>
28
+ variant: ror_stein_v
29
+ quantity: <%= rand(3) + 1 %>
30
+ price: 16.99
31
+ <% end %>
32
+
33
+ <% for i in 30..50 do%>
34
+ li_<%= i + 4000 %>:
35
+ order: order_<%= i %>
36
+ variant: ror_mug_v
37
+ quantity: <%= rand(10) + 1 %>
38
+ price: 13.99
39
+ <% end %>
40
+
@@ -0,0 +1,8 @@
1
+ size:
2
+ name: tshirt-size
3
+ presentation: Size
4
+ position: 1
5
+ color:
6
+ name: tshirt-color
7
+ presentation: Color
8
+ position: 2
@@ -0,0 +1,35 @@
1
+ s:
2
+ name: Small
3
+ presentation: S
4
+ position: 1
5
+ option_type: size
6
+ m:
7
+ name: Medium
8
+ presentation: M
9
+ position: 2
10
+ option_type: size
11
+ l:
12
+ name: Large
13
+ presentation: L
14
+ position: 3
15
+ option_type: size
16
+ xl:
17
+ name: Extra Large
18
+ presentation: XL
19
+ position: 4
20
+ option_type: size
21
+ red:
22
+ name: Red
23
+ presentation: Red
24
+ position: 1
25
+ option_type: color
26
+ green:
27
+ name: Green
28
+ presentation: Green
29
+ position: 2
30
+ option_type: color
31
+ blue:
32
+ name: Blue
33
+ presentation: Blue
34
+ position: 3
35
+ option_type: color
@@ -0,0 +1,20 @@
1
+ <%
2
+ order_date = Time.now
3
+ 1.upto(100) do |i|
4
+ order_date -= rand(12).hours
5
+ item_total = "#{1 + rand(400)}.#{rand(100)}".to_f
6
+ charges_total = "#{1 + rand(30)}.#{rand(100)}".to_f
7
+ %>
8
+ order_<%= i %>:
9
+ number: <%= "R#{Array.new(9){rand(9)}.join}" %>
10
+ user: user_<%= i %>
11
+ state: complete
12
+ email: <%= Faker::Internet.email %>
13
+ item_total: <%= item_total %>
14
+ created_at: <%= order_date.to_s(:db) %>
15
+ completed_at: <%= order_date.to_s(:db) %>
16
+ total: <%= item_total + charges_total %>
17
+ adjustment_total: <%= charges_total %>
18
+ ship_address: ship_address_<%= i %>
19
+ bill_address: bill_address_<%= i %>
20
+ <% end %>
@@ -0,0 +1,29 @@
1
+ bogus_dev:
2
+ name: Credit Card
3
+ description: Bogus payment gateway for development.
4
+ environment: development
5
+ active: true
6
+ type: Spree::Gateway::Bogus
7
+ check_method:
8
+ name: Check
9
+ description: Pay by check.
10
+ active: true
11
+ type: Spree::PaymentMethod::Check
12
+ bogus_test:
13
+ name: Credit Card
14
+ description: Bogus payment gateway for test.
15
+ environment: test
16
+ active: true
17
+ type: Spree::Gateway::Bogus
18
+ bogus_prod:
19
+ name: Credit Card
20
+ description: Bogus payment gateway for production.
21
+ environment: production
22
+ active: true
23
+ type: Spree::Gateway::Bogus
24
+ bogus_staging:
25
+ name: Credit Card
26
+ description: Bogus payment gateway for staging.
27
+ environment: staging
28
+ active: true
29
+ type: Spree::Gateway::Bogus
@@ -0,0 +1,29 @@
1
+ # create payments based on the totals since they can't be known in YAML (quantities are random)
2
+ method = Spree::PaymentMethod.where(:name => 'Credit Card', :active => true).first
3
+
4
+ # Hack the current method so we're able to return a gateway without a RAILS_ENV
5
+ Spree::Gateway.class_eval do
6
+ def self.current
7
+ Spree::Gateway::Bogus.new
8
+ end
9
+ end
10
+
11
+ # This table was previously called spree_creditcards, and older migrations
12
+ # reference it as such. Make it explicit here that this table has been renamed.
13
+ Spree::CreditCard.table_name = 'spree_credit_cards'
14
+
15
+ creditcard = Spree::CreditCard.create({ :cc_type => 'visa', :month => 12, :year => 2014, :last_digits => '1111',
16
+ :first_name => 'Sean', :last_name => 'Schofield',
17
+ :gateway_customer_profile_id => 'BGS-1234' }, :without_protection => true)
18
+
19
+ Spree::Order.all.each_with_index do |order, index|
20
+ printf "\rProcessing order #{index}"
21
+ STDOUT.flush
22
+ order.update!
23
+ payment = order.payments.create({ :amount => order.total, :source => creditcard.clone, :payment_method => method }, :without_protection => true)
24
+ payment.update_attributes_without_callbacks({
25
+ :state => 'pending',
26
+ :response_code => '12345'
27
+ })
28
+ end
29
+ puts
@@ -0,0 +1,21 @@
1
+ shipping_method = Spree::ShippingMethod.find_by_name("UPS Ground (USD)")
2
+ shipping_method.calculator.preferred_amount = 5
3
+ shipping_method.calculator.preferred_currency = 'USD'
4
+
5
+ shipping_method = Spree::ShippingMethod.find_by_name("UPS Ground (EUR)")
6
+ shipping_method.calculator.preferred_amount = 5
7
+ shipping_method.calculator.preferred_currency = 'EUR'
8
+
9
+ shipping_method = Spree::ShippingMethod.find_by_name("UPS One Day (USD)")
10
+ shipping_method.calculator.preferred_amount = 15
11
+ shipping_method.calculator.preferred_currency = 'USD'
12
+
13
+ shipping_method = Spree::ShippingMethod.find_by_name("UPS Two Day (USD)")
14
+ shipping_method.calculator.preferred_amount = 10
15
+ shipping_method.calculator.preferred_currency = 'USD'
16
+
17
+ # flat_rate_five_dollars:
18
+ # name: amount
19
+ # owner: flat_rate_coupon_calculator
20
+ # owner_type: Spree::Calculator
21
+ # value: 5
@@ -0,0 +1,224 @@
1
+ small-red-baseball-price-usd:
2
+ variant: small-red-baseball
3
+ amount: 19.99
4
+ currency: USD
5
+ small-blue-baseball-price-eur:
6
+ variant: small-blue-baseball
7
+ amount: 16.00
8
+ currency: EUR
9
+ small-green-baseball-price-usd:
10
+ variant: small-green-baseball
11
+ amount: 19.99
12
+ currency: USD
13
+ small-green-baseball-price-eur:
14
+ variant: small-green-baseball
15
+ amount: 16.00
16
+ currency: EUR
17
+ med-red-baseball-price-usd:
18
+ variant: med-red-baseball
19
+ amount: 19.99
20
+ currency: USD
21
+ med-red-baseball-price-eur:
22
+ variant: med-red-baseball
23
+ amount: 16.00
24
+ currency: EUR
25
+ med-blue-baseball-price-usd:
26
+ variant: med-blue-baseball
27
+ amount: 19.99
28
+ currency: USD
29
+ med-blue-baseball-price-eur:
30
+ variant: med-blue-baseball
31
+ amount: 16.00
32
+ currency: EUR
33
+ med-green-baseball-price-usd:
34
+ variant: med-green-baseball
35
+ amount: 19.99
36
+ currency: USD
37
+ med-green-baseball-price-eur:
38
+ variant: med-green-baseball
39
+ amount: 16.00
40
+ currency: EUR
41
+ large-red-baseball-price-usd:
42
+ variant: large-red-baseball
43
+ amount: 19.99
44
+ currency: USD
45
+ large-red-baseball-price-eur:
46
+ variant: large-red-baseball
47
+ amount: 16.00
48
+ currency: EUR
49
+ large-blue-baseball-price-usd:
50
+ variant: large-blue-baseball
51
+ amount: 19.99
52
+ currency: USD
53
+ large-blue-baseball-price-eur:
54
+ variant: large-blue-baseball
55
+ amount: 16.00
56
+ currency: EUR
57
+ large-green-baseball-price-usd:
58
+ variant: large-green-baseball
59
+ amount: 19.99
60
+ currency: USD
61
+ large-green-baseball-price-eur:
62
+ variant: large-green-baseball
63
+ amount: 16.00
64
+ currency: EUR
65
+ xlarge-green-baseball-price-usd:
66
+ variant: xlarge-green-baseball
67
+ amount: 21.99
68
+ currency: USD
69
+ xlarge-green-baseball-price-eur:
70
+ variant: xlarge-green-baseball
71
+ amount: 18.50
72
+ currency: EUR
73
+ ror_baseball_jersey_v-price-usd:
74
+ variant: ror_baseball_jersey_v
75
+ amount: 19.99
76
+ currency: USD
77
+ ror_baseball_jersey_v-price-eur:
78
+ variant: ror_baseball_jersey_v
79
+ amount: 16.00
80
+ currency: EUR
81
+ ror_tote_v-price-usd:
82
+ variant: ror_tote_v
83
+ amount: 15.99
84
+ currency: USD
85
+ ror_tote_v-price-eur:
86
+ variant: ror_tote_v
87
+ amount: 14.00
88
+ currency: EUR
89
+ ror_bag_v-price-usd:
90
+ variant: ror_bag_v
91
+ amount: 22.99
92
+ currency: USD
93
+ ror_bag_v-price-eur:
94
+ variant: ror_bag_v
95
+ amount: 19.00
96
+ currency: EUR
97
+ ror_jr_spaghetti_v-price-usd:
98
+ variant: ror_jr_spaghetti_v
99
+ amount: 19.99
100
+ currency: USD
101
+ ror_jr_spaghetti_v-price-eur:
102
+ variant: ror_jr_spaghetti_v
103
+ amount: 16.00
104
+ currency: EUR
105
+ ror_mug_v-price-usd:
106
+ variant: ror_mug_v
107
+ amount: 13.99
108
+ currency: USD
109
+ ror_mug_v-price-eur:
110
+ variant: ror_mug_v
111
+ amount: 12.00
112
+ currency: EUR
113
+ ror_ringer_v-price-usd:
114
+ variant: ror_ringer_v
115
+ amount: 19.99
116
+ currency: USD
117
+ ror_ringer_v-price-eur:
118
+ variant: ror_ringer_v
119
+ amount: 16.50
120
+ currency: EUR
121
+ ror_stein_v-price-usd:
122
+ variant: ror_stein_v
123
+ amount: 16.99
124
+ currency: USD
125
+ ror_stein_v-price-eur:
126
+ variant: ror_stein_v
127
+ amount: 14.00
128
+ currency: EUR
129
+ apache_baseball_jersey_v-price-usd:
130
+ variant: apache_baseball_jersey_v
131
+ amount: 19.99
132
+ currency: USD
133
+ apache_baseball_jersey_v-price-eur:
134
+ variant: apache_baseball_jersey_v
135
+ amount: 16.00
136
+ currency: EUR
137
+ ruby_baseball_jersey_v-price-usd:
138
+ variant: ruby_baseball_jersey_v
139
+ amount: 19.99
140
+ currency: USD
141
+ ruby_baseball_jersey_v-price-eur:
142
+ variant: ruby_baseball_jersey_v
143
+ amount: 16.00
144
+ currency: EUR
145
+ spree_baseball_jersey_v-price-usd:
146
+ variant: spree_baseball_jersey_v
147
+ amount: 19.99
148
+ currency: USD
149
+ spree_baseball_jersey_v-price-eur:
150
+ variant: spree_baseball_jersey_v
151
+ amount: 16.00
152
+ currency: EUR
153
+ spree_stein_v-price-usd:
154
+ variant: spree_stein_v
155
+ amount: 16.99
156
+ currency: USD
157
+ spree_stein_v-price-eur:
158
+ variant: spree_stein_v
159
+ amount: 14.00
160
+ currency: EUR
161
+ spree_jr_spaghetti_v-price-usd:
162
+ variant: spree_jr_spaghetti_v
163
+ amount: 19.99
164
+ currency: USD
165
+ spree_jr_spaghetti_v-price-eur:
166
+ variant: spree_jr_spaghetti_v
167
+ amount: 16.00
168
+ currency: EUR
169
+ spree_mug_v-price-usd:
170
+ variant: spree_mug_v
171
+ amount: 13.99
172
+ currency: USD
173
+ spree_mug_v-price-eur:
174
+ variant: spree_mug_v
175
+ amount: 12.00
176
+ currency: EUR
177
+ spree_ringer_v-price-usd:
178
+ variant: spree_ringer_v
179
+ amount: 17.99
180
+ currency: USD
181
+ spree_ringer_v-price-eur:
182
+ variant: spree_ringer_v
183
+ amount: 15.00
184
+ currency: EUR
185
+ spree_tote_v-price-usd:
186
+ variant: spree_tote_v
187
+ amount: 15.99
188
+ currency: USD
189
+ spree_tote_v-price-eur:
190
+ variant: spree_tote_v
191
+ amount: 14.00
192
+ currency: EUR
193
+ spree_bag_v-price-usd:
194
+ variant: spree_bag_v
195
+ amount: 22.99
196
+ currency: USD
197
+ spree_bag_v-price-eur:
198
+ variant: spree_bag_v
199
+ amount: 19.00
200
+ currency: EUR
201
+ small-spree-baseball-price-usd:
202
+ variant: small-spree-baseball
203
+ amount: 19.99
204
+ currency: USD
205
+ small-spree-baseball-price-eur:
206
+ variant: small-spree-baseball
207
+ amount: 16.00
208
+ currency: EUR
209
+ med-spree-baseball-price-usd:
210
+ variant: med-spree-baseball
211
+ amount: 19.99
212
+ currency: USD
213
+ med-spree-baseball-price-eur:
214
+ variant: med-spree-baseball
215
+ amount: 16.00
216
+ currency: EUR
217
+ large-spree-baseball-price-usd:
218
+ variant: large-spree-baseball
219
+ amount: 19.99
220
+ currency: USD
221
+ large-spree-baseball-price-eur:
222
+ variant: large-spree-baseball
223
+ amount: 16.00
224
+ currency: EUR