@spree/docs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/README.md +54 -0
  2. package/dist/api-reference/platform/authentication.md +38 -0
  3. package/dist/api-reference/store-api/authentication.md +188 -0
  4. package/dist/api-reference/store-api/errors.md +277 -0
  5. package/dist/api-reference/store-api/idempotency.md +129 -0
  6. package/dist/api-reference/store-api/introduction.md +34 -0
  7. package/dist/api-reference/store-api/localization.md +279 -0
  8. package/dist/api-reference/store-api/metadata.md +160 -0
  9. package/dist/api-reference/store-api/monetary-amounts.md +65 -0
  10. package/dist/api-reference/store-api/querying.md +399 -0
  11. package/dist/api-reference/store-api/rate-limitting.md +103 -0
  12. package/dist/api-reference/store-api/relations.md +185 -0
  13. package/dist/api-reference/storefront/authentication.md +88 -0
  14. package/dist/api-reference/tutorials/adyen-integration-guide-for-android.md +165 -0
  15. package/dist/api-reference/tutorials/adyen-integration-guide-for-ios.md +194 -0
  16. package/dist/api-reference/tutorials/quick-checkout-with-stripe.md +248 -0
  17. package/dist/api-reference/v2/fetching-multiple-resources.md +26 -0
  18. package/dist/api-reference/v2/filtering-and-sorting.md +53 -0
  19. package/dist/api-reference/v2/introduction.md +22 -0
  20. package/dist/api-reference/v2/pagination.md +37 -0
  21. package/dist/api-reference/webhooks-events.md +883 -0
  22. package/dist/developer/admin/admin.md +205 -0
  23. package/dist/developer/admin/authentication.md +59 -0
  24. package/dist/developer/admin/components.md +711 -0
  25. package/dist/developer/admin/custom-css.md +243 -0
  26. package/dist/developer/admin/custom-javascript.md +116 -0
  27. package/dist/developer/admin/extending-ui.md +1964 -0
  28. package/dist/developer/admin/form-builder.md +444 -0
  29. package/dist/developer/admin/helper-methods.md +531 -0
  30. package/dist/developer/admin/navigation.md +805 -0
  31. package/dist/developer/admin/tables.md +491 -0
  32. package/dist/developer/advanced/adding_spree_to_rails_app.md +106 -0
  33. package/dist/developer/cli/quickstart.md +137 -0
  34. package/dist/developer/contributing/creating-an-extension.md +258 -0
  35. package/dist/developer/contributing/developing-spree.md +339 -0
  36. package/dist/developer/contributing/quickstart.md +32 -0
  37. package/dist/developer/contributing/updating-extensions.md +67 -0
  38. package/dist/developer/core-concepts/addresses.md +265 -0
  39. package/dist/developer/core-concepts/adjustments.md +107 -0
  40. package/dist/developer/core-concepts/architecture.md +177 -0
  41. package/dist/developer/core-concepts/calculators.md +323 -0
  42. package/dist/developer/core-concepts/customers.md +230 -0
  43. package/dist/developer/core-concepts/events.md +624 -0
  44. package/dist/developer/core-concepts/imports-exports.md +698 -0
  45. package/dist/developer/core-concepts/inventory.md +191 -0
  46. package/dist/developer/core-concepts/markets.md +250 -0
  47. package/dist/developer/core-concepts/media.md +167 -0
  48. package/dist/developer/core-concepts/metafields.md +187 -0
  49. package/dist/developer/core-concepts/orders.md +328 -0
  50. package/dist/developer/core-concepts/payments.md +710 -0
  51. package/dist/developer/core-concepts/pricing.md +163 -0
  52. package/dist/developer/core-concepts/products.md +360 -0
  53. package/dist/developer/core-concepts/promotions.md +322 -0
  54. package/dist/developer/core-concepts/reports.md +206 -0
  55. package/dist/developer/core-concepts/search-filtering.md +237 -0
  56. package/dist/developer/core-concepts/shipments.md +212 -0
  57. package/dist/developer/core-concepts/slugs.md +111 -0
  58. package/dist/developer/core-concepts/staff-roles.md +123 -0
  59. package/dist/developer/core-concepts/store-credits-gift-cards.md +317 -0
  60. package/dist/developer/core-concepts/stores.md +117 -0
  61. package/dist/developer/core-concepts/taxes.md +135 -0
  62. package/dist/developer/core-concepts/translations.md +120 -0
  63. package/dist/developer/core-concepts/users.md +299 -0
  64. package/dist/developer/core-concepts/webhooks.md +378 -0
  65. package/dist/developer/create-spree-app/quickstart.md +158 -0
  66. package/dist/developer/customization/api.md +93 -0
  67. package/dist/developer/customization/authentication.md +88 -0
  68. package/dist/developer/customization/checkout.md +204 -0
  69. package/dist/developer/customization/configuration.md +55 -0
  70. package/dist/developer/customization/decorators.md +523 -0
  71. package/dist/developer/customization/dependencies.md +232 -0
  72. package/dist/developer/customization/emails.md +21 -0
  73. package/dist/developer/customization/extensions.md +92 -0
  74. package/dist/developer/customization/metadata.md +236 -0
  75. package/dist/developer/customization/model-preferences.md +130 -0
  76. package/dist/developer/customization/permissions.md +265 -0
  77. package/dist/developer/customization/quickstart.md +229 -0
  78. package/dist/developer/customization/routes.md +24 -0
  79. package/dist/developer/customization/v4/admin-panel.md +78 -0
  80. package/dist/developer/customization/v4/authentication.md +210 -0
  81. package/dist/developer/customization/v4/checkout.md +212 -0
  82. package/dist/developer/customization/v4/deface.md +251 -0
  83. package/dist/developer/customization/v4/images.md +86 -0
  84. package/dist/developer/customization/v4/storefront.md +450 -0
  85. package/dist/developer/deployment/assets.md +87 -0
  86. package/dist/developer/deployment/aws.md +335 -0
  87. package/dist/developer/deployment/caching.md +27 -0
  88. package/dist/developer/deployment/cdn.md +39 -0
  89. package/dist/developer/deployment/database.md +155 -0
  90. package/dist/developer/deployment/docker.md +128 -0
  91. package/dist/developer/deployment/emails.md +77 -0
  92. package/dist/developer/deployment/environment_variables.md +111 -0
  93. package/dist/developer/deployment/heroku.md +51 -0
  94. package/dist/developer/deployment/render.md +95 -0
  95. package/dist/developer/getting-started/quickstart.md +82 -0
  96. package/dist/developer/how-to/custom-payment-method.md +374 -0
  97. package/dist/developer/how-to/custom-promotion.md +373 -0
  98. package/dist/developer/how-to/custom-report.md +387 -0
  99. package/dist/developer/how-to/custom-search-provider.md +230 -0
  100. package/dist/developer/multi-store/quickstart.md +71 -0
  101. package/dist/developer/multi-store/setup.md +38 -0
  102. package/dist/developer/multi-tenant/configuration.md +41 -0
  103. package/dist/developer/multi-tenant/core-concepts.md +75 -0
  104. package/dist/developer/multi-tenant/installation.md +96 -0
  105. package/dist/developer/multi-tenant/quickstart.md +20 -0
  106. package/dist/developer/multi-vendor/installation.md +45 -0
  107. package/dist/developer/multi-vendor/quickstart.md +17 -0
  108. package/dist/developer/sdk/admin/quickstart.md +22 -0
  109. package/dist/developer/sdk/authentication.md +89 -0
  110. package/dist/developer/sdk/configuration.md +225 -0
  111. package/dist/developer/sdk/quickstart.md +82 -0
  112. package/dist/developer/sdk/store/account.md +67 -0
  113. package/dist/developer/sdk/store/cart-checkout.md +140 -0
  114. package/dist/developer/sdk/store/markets.md +151 -0
  115. package/dist/developer/sdk/store/payments.md +96 -0
  116. package/dist/developer/sdk/store/products.md +149 -0
  117. package/dist/developer/sdk/store/wishlists.md +52 -0
  118. package/dist/developer/security/pci_compliance.md +15 -0
  119. package/dist/developer/security/security_policy.md +68 -0
  120. package/dist/developer/storefront/blocks.md +285 -0
  121. package/dist/developer/storefront/custom-css.md +260 -0
  122. package/dist/developer/storefront/custom-javascript.md +166 -0
  123. package/dist/developer/storefront/helper-methods.md +1288 -0
  124. package/dist/developer/storefront/links.md +298 -0
  125. package/dist/developer/storefront/nextjs/architecture.md +150 -0
  126. package/dist/developer/storefront/nextjs/customization.md +141 -0
  127. package/dist/developer/storefront/nextjs/deployment.md +180 -0
  128. package/dist/developer/storefront/nextjs/quickstart.md +92 -0
  129. package/dist/developer/storefront/nextjs/spree-next-package.md +314 -0
  130. package/dist/developer/storefront/pages.md +163 -0
  131. package/dist/developer/storefront/sections.md +569 -0
  132. package/dist/developer/storefront/storefront.md +56 -0
  133. package/dist/developer/storefront/themes.md +161 -0
  134. package/dist/developer/tutorial/admin.md +134 -0
  135. package/dist/developer/tutorial/extending-models.md +380 -0
  136. package/dist/developer/tutorial/file-uploads.md +121 -0
  137. package/dist/developer/tutorial/introduction.md +33 -0
  138. package/dist/developer/tutorial/model.md +41 -0
  139. package/dist/developer/tutorial/page-builder.md +487 -0
  140. package/dist/developer/tutorial/rich-text.md +73 -0
  141. package/dist/developer/tutorial/seo.md +332 -0
  142. package/dist/developer/tutorial/storefront.md +352 -0
  143. package/dist/developer/tutorial/testing.md +558 -0
  144. package/dist/developer/upgrades/2.0-to-2.1.md +46 -0
  145. package/dist/developer/upgrades/2.1-to-2.2.md +59 -0
  146. package/dist/developer/upgrades/2.2-to-2.3.md +44 -0
  147. package/dist/developer/upgrades/2.3-to-2.4.md +42 -0
  148. package/dist/developer/upgrades/3.0-to-3.1.md +47 -0
  149. package/dist/developer/upgrades/3.1-to-3.2.md +34 -0
  150. package/dist/developer/upgrades/3.2-to-3.3.md +70 -0
  151. package/dist/developer/upgrades/3.3-to-3.4.md +36 -0
  152. package/dist/developer/upgrades/3.4-to-3.5.md +44 -0
  153. package/dist/developer/upgrades/3.5-to-3.6.md +40 -0
  154. package/dist/developer/upgrades/3.6-to-3.7.md +62 -0
  155. package/dist/developer/upgrades/3.7-to-4.0.md +152 -0
  156. package/dist/developer/upgrades/4.0-to-4.1.md +92 -0
  157. package/dist/developer/upgrades/4.1-to-4.2.md +109 -0
  158. package/dist/developer/upgrades/4.10-to-5.0.md +129 -0
  159. package/dist/developer/upgrades/4.2-to-4.3.md +100 -0
  160. package/dist/developer/upgrades/4.3-to-4.4.md +125 -0
  161. package/dist/developer/upgrades/4.4-to-4.5.md +94 -0
  162. package/dist/developer/upgrades/4.5-to-4.6.md +119 -0
  163. package/dist/developer/upgrades/4.6-to-4.7.md +39 -0
  164. package/dist/developer/upgrades/4.8-to-4.9.md +24 -0
  165. package/dist/developer/upgrades/4.9-to-4.10.md +24 -0
  166. package/dist/developer/upgrades/4.x-to-4.8.md +52 -0
  167. package/dist/developer/upgrades/5.0-to-5.1.md +28 -0
  168. package/dist/developer/upgrades/5.1-to-5.2.md +127 -0
  169. package/dist/developer/upgrades/5.2-to-5.3.md +338 -0
  170. package/dist/developer/upgrades/5.3-to-5.4.md +248 -0
  171. package/dist/developer/upgrades/quickstart.md +36 -0
  172. package/dist/integrations/analytics/google-analytics.md +64 -0
  173. package/dist/integrations/analytics/google-tag-manager.md +78 -0
  174. package/dist/integrations/integrations.md +39 -0
  175. package/dist/integrations/marketing/klaviyo.md +99 -0
  176. package/dist/integrations/payments/adyen.md +90 -0
  177. package/dist/integrations/payments/paypal.md +41 -0
  178. package/dist/integrations/payments/razorpay.md +45 -0
  179. package/dist/integrations/payments/stripe.md +109 -0
  180. package/dist/integrations/search/meilisearch.md +236 -0
  181. package/dist/integrations/sso-mfa-social-login/admin-dashboard.md +57 -0
  182. package/dist/integrations/sso-mfa-social-login/storefront.md +56 -0
  183. package/package.json +27 -0
@@ -0,0 +1,42 @@
1
+ ---
2
+ title: 2.3 to 2.4
3
+ section: upgrades
4
+ description: 'This guide covers upgrading a 2.3 Spree store, to a 2.4 store.'
5
+ ---
6
+
7
+ This guide has been written from the perspective of a blank Spree 2.3 store with no extensions.
8
+
9
+ If you have extensions that your store depends on, you will need to manually verify that each of those extensions works within your 2.4 store once this upgrade is complete. Typically, extensions that are compatible with this version of Spree will have a 2-4-stable branch.
10
+
11
+ ## Upgrade Rails
12
+
13
+ For this Spree release, you will need to upgrade your Rails version to at least 4.1.8.
14
+
15
+ ```ruby
16
+ gem 'rails', '~> 4.1.8'
17
+ ```
18
+
19
+ ## Upgrade Spree
20
+
21
+ ```ruby
22
+ gem 'spree', '~> 2.4'
23
+ ```
24
+
25
+ Run `bundle update spree`.
26
+
27
+ ## Copy and run migrations
28
+
29
+ Copy over the migrations from Spree (and any other engine) and run them using
30
+ these commands:
31
+
32
+ ```bash
33
+ rake railties:install:migrations
34
+ ```
35
+
36
+ ```bash
37
+ rake db:migrate
38
+ ```
39
+
40
+ ## Read the release notes
41
+
42
+ For information about changes contained within this release, please read the [2.4.0 Release Notes](https://github.com/spree/spree/releases/tag/v2.4.0).
@@ -0,0 +1,47 @@
1
+ ---
2
+ title: 3.0 to 3.1
3
+ section: upgrades
4
+ order: 9
5
+ description: 'This guide covers upgrading a 3.0 Spree store, to a 3.1 store'
6
+ ---
7
+
8
+ ## Update gems
9
+
10
+ ```bash
11
+ bundle update
12
+ ```
13
+
14
+ ## Copy and run migrations
15
+
16
+ Copy over the migrations from Spree and any other engine and run them using these commands:
17
+
18
+ ```bash
19
+ rake railties:install:migrations
20
+ rake db:migrate
21
+ ```
22
+
23
+ ## Additional information
24
+
25
+ ### Make sure to v1 namespace custom rabl templates & overrides.
26
+
27
+ If your rabl templates reference others with extend you'll need to add the v1 namespace.
28
+
29
+ For example:
30
+
31
+ ```ruby
32
+ extends 'spree/api/zones/show'
33
+ ```
34
+
35
+ Becomes:
36
+
37
+ ```ruby
38
+ extends 'spree/api/v1/zones/show'
39
+ ```
40
+
41
+ ### Remove `Spree::Config.check_for_spree_alerts`
42
+
43
+ If you were disabling the alert checks you'll now want to remove this preference from `config/initializers/spree.rb` as it's no longer used.
44
+
45
+ ## Read the release notes
46
+
47
+ For information about changes contained within this release, please read the [3.1.0 Release Notes](https://github.com/spree/spree/releases/tag/v3.1.0).
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: 3.1 to 3.2
3
+ section: upgrades
4
+ order: 8
5
+ description: 'This guide covers upgrading a 3.1 Spree store, to a 3.2 store.'
6
+ ---
7
+
8
+ ### Update your Rails version to 5.0
9
+
10
+ Spree 3.1 requires Rails 4.2 at a minimum. Please follow the [official Rails guide](http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-4-2-to-rails-5-0) to upgrade your application.
11
+
12
+ ### Update gems
13
+
14
+ ```bash
15
+ bundle update
16
+ ```
17
+
18
+ ### Run `bundle update`
19
+
20
+ ### Install missing migrations
21
+
22
+ ```bash
23
+ rake railties:install:migrations
24
+ ```
25
+
26
+ ### Run migrations
27
+
28
+ ```bash
29
+ rails db:migrate
30
+ ```
31
+
32
+ ## Read the release notes
33
+
34
+ For information about changes contained within this release, please read the [3.2.0 Release Notes](https://github.com/spree/spree/releases/tag/v3.2.0).
@@ -0,0 +1,70 @@
1
+ ---
2
+ title: 3.2 to 3.3
3
+ section: upgrades
4
+ order: 7
5
+ description: 'This guide covers upgrading a 3.2 Spree store, to a 3.3 store.'
6
+ ---
7
+
8
+ ### Update your Rails version to 5.1
9
+
10
+ Spree 3.3 requires Rails 5.1 at a minimum. Please follow the [official Rails guide](http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-5-0-to-rails-5-1) to upgrade your application.
11
+
12
+ ### Update gems
13
+
14
+ ```bash
15
+ bundle update
16
+ ```
17
+
18
+ ### Install missing migrations
19
+
20
+ ```bash
21
+ rake railties:install:migrations
22
+ ```
23
+
24
+ ### Run migrations
25
+
26
+ ```bash
27
+ rails db:migrate
28
+ ```
29
+
30
+ ### Include `UserMethods` in your `User` class
31
+
32
+ With this release, we're not including this automatically. You need to do it manually if you're not using `spree_auth_devise`.
33
+
34
+ You need to include `Spree::UserMethods` in your user class, eg.
35
+
36
+ ```ruby
37
+ class User
38
+ include UserAddress
39
+ include UserMethods
40
+ include UserPaymentSource
41
+ end
42
+ ```
43
+
44
+ ### Update `aws-sdk` gem to `>= 2.0`
45
+
46
+ Spree 3.3 comes with paperclip 5.1 support so if you're using Amazon S3 storage you need to change in your Gemfile, from:
47
+
48
+ ```ruby
49
+ gem 'aws-sdk', '< 2.0'
50
+ ```
51
+
52
+ to:
53
+
54
+ ```ruby
55
+ gem 'aws-sdk', '>= 2.0'
56
+ ```
57
+
58
+ and run `bundle update aws-sdk`
59
+
60
+ In your paperclip configuration, you also need to specify `s3_region` attribute eg. [https://github.com/spree/spree/blame/master/guides/content/developer/customization/s3_storage.md\#L27](https://github.com/spree/spree/blame/master/guides/content/developer/customization/s3_storage#L27)
61
+
62
+ See also [RubyThursday episode](https://rubythursday.com/episodes/ruby-snack-27-upgrade-paperclip-and-aws-sdk-in-prep-for-rails-5) walkthrough of upgrading paperclip in your project.
63
+
64
+ ### Add jquery.validate to your project if you've used it directly from Spree
65
+
66
+ If your application.js file includes line `//= require jquery.validate/jquery.validate.min` you will need to add this file manually to your project because this library was [removed from Spree in favor of native HTML5 validation](https://github.com/spree/spree/pull/8173).
67
+
68
+ ## Read the release notes
69
+
70
+ For information about changes contained within this release, please read the [3.3.0 Release Notes](https://github.com/spree/spree/releases/tag/v3.3.0).
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: 3.3 to 3.4
3
+ section: upgrades
4
+ order: 6
5
+ description: 'This guide covers upgrading a 3.3 Spree store, to a 3.4 store.'
6
+ ---
7
+
8
+ ### Update gems
9
+
10
+ ```bash
11
+ bundle update
12
+ ```
13
+
14
+ ### Install missing migrations
15
+
16
+ ```bash
17
+ rake railties:install:migrations
18
+ ```
19
+
20
+ ### Run migrations
21
+
22
+ ```bash
23
+ rails db:migrate
24
+ ```
25
+
26
+ ### Migrate Spree::Taxon icons to Spree Assets
27
+
28
+ We changed `Spree::Taxon` icon to use `Spree::Asset` to unify attachment usage across all Spree models. If you were using icon images in `Spree::Taxon` please run this to migrate your icons:
29
+
30
+ ```bash
31
+ rails db:migrate_taxon_icons
32
+ ```
33
+
34
+ ## Read the release notes
35
+
36
+ For information about changes contained within this release, please read the [3.4.0 Release Notes](https://github.com/spree/spree/releases/tag/v3.4.0).
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: 3.4 to 3.5
3
+ section: upgrades
4
+ order: 5
5
+ description: 'This guide covers upgrading a 3.4 Spree store, to a 3.5 store.'
6
+ ---
7
+
8
+ ### Update gems
9
+
10
+ ```bash
11
+ bundle update
12
+ ```
13
+
14
+ ### Install missing migrations
15
+
16
+ ```bash
17
+ rake railties:install:migrations
18
+ ```
19
+
20
+ ### Run migrations
21
+
22
+ ```bash
23
+ rails db:migrate
24
+ ```
25
+
26
+ ### Install Spree Analytics Trackers extension
27
+
28
+ If you were previously using Analytics Trackers feature you need to install it as an extension as it was [extracted from the core](https://github.com/spree/spree/pull/8408).
29
+
30
+ 1. Add [Spree Analytics Trackers](https://github.com/spree-contrib/spree_analytics_trackers) to your `Gemfile`:
31
+
32
+ ```bash
33
+ bundle add spree_analytics_trackers
34
+ ```
35
+
36
+ 2. Copy and run migrations:
37
+
38
+ ```bash
39
+ bin/rails g spree_analytics_trackers:install
40
+ ```
41
+
42
+ ## Read the release notes
43
+
44
+ For information about changes contained within this release, please read the [3.5.0 Release Notes](https://github.com/spree/spree/releases/tag/v3.5.0).
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: 3.5 to 3.6
3
+ section: upgrades
4
+ order: 4
5
+ description: 'This guide covers upgrading a 3.5 Spree application, to a 3.6 application.'
6
+ ---
7
+
8
+ ## Update your Rails version to 5.2
9
+
10
+ Spree 3.6 requires Rails 5.2 at a minimum. Please follow the [official Rails guide](http://guides.rubyonrails.org/5_2_release_notes.html#upgrading-to-rails-5-2) to upgrade your application.
11
+
12
+ ## Update gems
13
+
14
+ ```bash
15
+ bundle update
16
+ ```
17
+
18
+ ### (Optional) Migrate to ActiveStorage (optional)
19
+
20
+ Please follow the [official paperclip guide](https://github.com/thoughtbot/paperclip/blob/master/MIGRATING) if you want to use ActiveStorage instead of paperclip.
21
+
22
+ You can still use paperclip for attachment management by setting `SPREE_USE_PAPERCLIP` environment variable to `true`, but keep in mind that paperclip is DEPRECATED and we will remove paperclip support in Spree 4.0.
23
+
24
+ ### Install missing migrations
25
+
26
+ ```bash
27
+ rake railties:install:migrations
28
+ ```
29
+
30
+ ### Run migrations
31
+
32
+ ```bash
33
+ rails db:migrate
34
+ ```
35
+
36
+ You're good to go!
37
+
38
+ ## Read the release notes
39
+
40
+ For information about changes contained within this release, please read the [3.6.0 Release Notes](https://github.com/spree/spree/releases/tag/v3.6.0).
@@ -0,0 +1,62 @@
1
+ ---
2
+ title: 3.6 to 3.7
3
+ section: upgrades
4
+ order: 3
5
+ description: 'This guide covers upgrading a 3.6 Spree application, to version 3.7.'
6
+ ---
7
+
8
+ ## Update gems
9
+
10
+ Run
11
+
12
+ ```bash
13
+ bundle update
14
+ ```
15
+
16
+ ## Install missing migrations
17
+
18
+ ```bash
19
+ rake railties:install:migrations
20
+ ```
21
+
22
+ ## Run migrations
23
+
24
+ ```bash
25
+ rails db:migrate
26
+ ```
27
+
28
+ ## Migrate Taxon icons to Spree Assets
29
+
30
+ We renamed `TaxonIcon` to `TaxonImage` to clarify usage of this model. If you were using `TaxonIcon` please run this to migrate your icons to images:
31
+
32
+ ```bash
33
+ rails db:migrate_taxon_icons_to_images
34
+ ```
35
+
36
+ ## Ensure all Orders associated to Store
37
+
38
+ Orders needs to be associated to Stores. To ensure all existing `Order` are associated with `Store` please run this:
39
+
40
+ ```bash
41
+ rails db:associate_orders_with_store
42
+ ```
43
+
44
+ This will associate all Orders without Store to the default Store. This can take some time depending on your volume of data.
45
+
46
+ ## Ensure all Orders have currency present
47
+
48
+ To enhance multi currency capabilities we've made `currency` presence obligatory in `Order` model. To ensure all existing `Orders` have `currency` present please run this command:
49
+
50
+ ```bash
51
+ rails db:ensure_order_currency_presence
52
+ ```
53
+
54
+ This will set `currency` in Orders without currency set to `Spree::Config[:default_currency]` value. This can take some time depending on your volume of data.
55
+
56
+ ## Replace `guest_token` with `token` in your codebase
57
+
58
+ `Order#guest_token` was renamed to `Order#token` in order to unify the experience for guest checkouts and orders placed by signed in users.
59
+
60
+ ## Read the release notes
61
+
62
+ For information about changes contained within this release, please read the [3.7.0 Release Notes](https://github.com/spree/spree/releases/tag/v3.7.0).
@@ -0,0 +1,152 @@
1
+ ---
2
+ title: 3.7 to 4.0
3
+ section: upgrades
4
+ order: 2
5
+ description: This guide covers upgrading a 3.7 Spree application to Spree 4.0.
6
+ ---
7
+
8
+ > **NOTE:** If you're on an older version than 3.7 please follow previous upgrade guides and perform those upgrades incrementally**, eg.
9
+ >
10
+ > 1. [upgrade 3.4 to 3.5](3.4-to-3.5)
11
+ > 2. [upgrade 3.5 to 3.6](3.5-to-3.6)
12
+ > 3. [upgrade 3.6 to 3.7](3.6-to-3.7)
13
+
14
+ ## Update your Ruby version to 2.5 or later
15
+
16
+ Spree 4.0 requires Ruby 2.5 so you need to change the ruby version in your project's `Gemfile` and `.ruby-version` files. And of course you need to install Ruby 2.5 or later. If you're using RVM you can do it like this:
17
+
18
+ ```bash
19
+ rvm install 2.5
20
+ rvm use 2.5
21
+ ```
22
+
23
+ ## Migrate from Paperclip to ActiveStorage
24
+
25
+ In Spree 3.6 we deprecated [Paperclip support in favor of ActiveStorage](https://guides.spreecommerce.org/release_notes/3_6_0.html#active-storage-support). Paperclip gem itself isn't maintained anymore and it is recommended to move to ActiveStorage as it is the default Rails storage engine since Rails 5.2 release.
26
+
27
+ In Spree 4.0 we've removed Paperclip support in favor of ActiveStorage.
28
+
29
+ Please remove also any occurrences of `Rails.application.config.use_paperclip` and `Configuration::Paperclip` from your codebase.
30
+
31
+ Please follow the [official Paperclip to ActiveStorage migration guide](https://github.com/thoughtbot/paperclip/blob/master/MIGRATING).
32
+
33
+ ## Remove `spree_address_book` extension
34
+
35
+ If you're using the [Address Book](https://github.com/spree-contrib/spree_address_book) extension you need to remove it as this feature was merged into [core Spree](https://github.com/spree/spree/releases/tag/v4.0.0).
36
+
37
+ 1. Remove this line from `Gemfile`
38
+
39
+ ```bash
40
+ bundle remove spree_address_book
41
+ ```
42
+
43
+ 2. Remove this line from `vendor/assets/javascripts/spree/frontend/all.js`
44
+
45
+ ```text
46
+ //= require spree/frontend/spree_address_book
47
+ ```
48
+
49
+ 3. Remove this line from `vendor/assets/stylesheets/spree/frontend/all.css`
50
+
51
+ ```text
52
+ //= require spree/frontend/spree_address_book
53
+ ```
54
+
55
+ ## Update your `Gemfile`
56
+
57
+ ```ruby
58
+ gem 'spree', '~> 4.0'
59
+ gem 'spree_auth_devise', '~> 4.0'
60
+ gem 'spree_gateway', '~> 3.6'
61
+ ```
62
+
63
+ and run
64
+
65
+ ```bash
66
+ bundle update
67
+ ```
68
+
69
+ ## Replace `class_eval` with `Module.prepend` only for Rails 6
70
+
71
+ Rails 6.0 ships with a [new code autoloader called Zeitwerk](https://medium.com/@fxn/zeitwerk-a-new-code-loader-for-ruby-ae7895977e73) which has some [strict rules in terms of file naming and contents](https://github.com/fxn/zeitwerk#file-structure). If you used `class_eval` to extend and modify Spree classes you will need to rewrite those with `Module.prepend`. Eg.
72
+
73
+ Old decorator syntax:
74
+
75
+ ```ruby
76
+ Spree::Order.class_eval do
77
+ has_many :new_custom_model
78
+
79
+ def some_method
80
+ # ...
81
+ end
82
+ end
83
+ ```
84
+
85
+ Replaced with:
86
+
87
+ ```ruby
88
+ module Spree
89
+ module OrderDecorator
90
+ def self.prepended(base)
91
+ base.has_many :new_custom_model
92
+ end
93
+
94
+ def some_method
95
+ # ...
96
+ end
97
+ end
98
+
99
+ Order.prepend(OrderDecorator)
100
+ end
101
+ ```
102
+
103
+ When migrating a class method to the new [autoloader](https://medium.com/@fxn/zeitwerk-a-new-code-loader-for-ruby-ae7895977e73) things are a little different because you will have to prepend to the Singleton class as shown in this example:
104
+
105
+ ```ruby
106
+ module Spree::BaseDecorator
107
+ def spree_base_scopes
108
+ # custom implementation
109
+ end
110
+ end
111
+
112
+ Spree::Base.singleton_class.send :prepend, Spree::BaseDecorator
113
+ ```
114
+
115
+ Please also consider other options for [Logic Customization](/developer/customization).
116
+
117
+ We recommend also reading through [Ruby modules: Include vs Prepend vs Extend](https://medium.com/@leo_hetsch/ruby-modules-include-vs-prepend-vs-extend-f09837a5b073)
118
+
119
+ ## Update Bootstrap 3 to 4 or stay at Bootstrap 3
120
+
121
+ Spree 4 uses Bootstrap 4 for both Storefront and Admin Panel. You have two options:
122
+
123
+ ### Stay at Bootstrap 3
124
+
125
+ As we know this is a big portion of work you can still use Bootstrap 3 for your Storefront.
126
+
127
+ 1. Copy all remaining views by running `bundle exec spree:frontend:copy_views`
128
+ 2. Add `bootstrap-sass` gem to your `Gemfile`
129
+
130
+ ```ruby
131
+ gem 'bootstrap-sass', '~> 3.4.1'
132
+ ```
133
+
134
+ ### Move to Bootstrap 4
135
+
136
+ [Follow the official Bootstrap 3 to 4 migration guide](https://getbootstrap.com/docs/4.0/migration/)
137
+
138
+ ## Install missing migrations
139
+
140
+ ```bash
141
+ rake railties:install:migrations
142
+ ```
143
+
144
+ ## Run migrations
145
+
146
+ ```bash
147
+ rails db:migrate
148
+ ```
149
+
150
+ ## Read the release notes
151
+
152
+ For information about changes contained within this release, please read the [4.0.0 Release Notes](https://github.com/spree/spree/releases/tag/v4.0.0)
@@ -0,0 +1,92 @@
1
+ ---
2
+ title: 4.0 to 4.1
3
+ section: upgrades
4
+ order: 1
5
+ description: This guide covers upgrading a 4.0 Spree application to Spree 4.1.
6
+ ---
7
+
8
+ > **NOTE:** If you're on an older version than 4.0 please follow previous upgrade guides and perform those upgrades incrementally**, eg.
9
+ >
10
+ > 1. [upgrade 3.5 to 3.6](3.5-to-3.6)
11
+ > 2. [upgrade 3.6 to 3.7](3.6-to-3.7)
12
+ > 3. [upgrade 3.7 to 4.0](3.7-to-4.0)
13
+
14
+ ## Update gems
15
+
16
+ Run the following command to update your gems to 4.1:
17
+
18
+ ```bash
19
+ bundle update
20
+ ```
21
+
22
+ ## Install missing migrations
23
+
24
+ ```bash
25
+ rake railties:install:migrations
26
+ ```
27
+
28
+ ## Run migrations
29
+
30
+ ```bash
31
+ rails db:migrate
32
+ ```
33
+
34
+ ## Storefront upgrade
35
+
36
+ You have two options:
37
+
38
+ 1. Migrate to the new Storefront UI
39
+ 2. Stay at the current UI
40
+
41
+ ## Migrate to the new Storefront UI
42
+
43
+ Spree 4.1 comes with a completely new mobile-first ultra-fast Storefront powered by Turbolinks.
44
+
45
+ To replace your current frontend with the new Spree UI follow these steps:
46
+
47
+ 1. In your project root directory run:
48
+
49
+ ```bash
50
+ rails g spree:frontend:copy_storefront
51
+ ```
52
+
53
+ **WARNING** this will overwrite your current project templates, it's required for the new UI, so if you'll be asked by the generator what to do please choose **A** to proceed
54
+
55
+ 3. Next, you will need to copy over two files:
56
+ * [spree_storefront.rb](https://raw.githubusercontent.com/spree/spree/main/core/lib/generators/spree/install/templates/config/initializers/spree_storefront.rb) to `config/initializers/spree_storefront.rb`
57
+ * [spree_storefront.yml](https://raw.githubusercontent.com/spree/spree/main/core/lib/generators/spree/install/templates/config/spree_storefront.yml) to `config/spree_storefront.yml`
58
+ 4. If you overwrote any `spree_frontend` [controllers](https://github.com/spree/spree/tree/master/frontend/app/controllers) you will need to either remove your local copies or move your custom logic to [decorators](/developer/customization#extending-controllers)
59
+ 5. The same goes for [helpers](https://github.com/spree/spree/tree/master/frontend/app/helpers/spree)
60
+ 6. You will also need to remove this line:
61
+
62
+ ```javascript
63
+ //= require spree/frontend/spree_auth
64
+ ```
65
+
66
+ from `vendor/assets/javascripts/spree/frontend.all.js` file
67
+
68
+ ## Stay at the current UI
69
+
70
+ If you wish to not move to the new Storefront UI it's still an option. Just proceed with the steps described below.
71
+
72
+ 1. Copy over all views from Spree 4.0
73
+
74
+ Copy overviews from: [https://github.com/spree/spree/tree/4-0-stable/frontend/app/views](https://github.com/spree/spree/tree/4-0-stable/frontend/app/views) to your application views directory: `app/views`
75
+
76
+ **WARNING** remember to not overwrite your customizations!
77
+
78
+ 2. Copy over all Stylesheets from Spree 4.0
79
+
80
+ Copy over stylesheets from: [https://github.com/spree/spree/tree/4-0-stable/frontend/app/assets/stylesheets](https://github.com/spree/spree/tree/4-0-stable/frontend/app/assets/stylesheets) to `app/stylesheets`
81
+
82
+ **WARNING** remember to not overwrite your customizations!
83
+
84
+ 3. Copy over all JavaScript from Spree 4.0
85
+
86
+ Copy over stylesheets from: [https://github.com/spree/spree/tree/4-0-stable/frontend/app/assets/javascripts](https://github.com/spree/spree/tree/4-0-stable/frontend/app/assets/javascripts) to `app/javascripts`
87
+
88
+ **WARNING** remember to not overwrite your customizations!
89
+
90
+ ## Read the release notes
91
+
92
+ For information about changes contained within this release, please read the [4.1.0 Release Notes](https://github.com/spree/spree/releases/tag/v4.1.0).