@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,450 @@
1
+ > **NOTE:** This section covers the Rails storefront which was extracted to [`spree_frontend`](https://github.com/spree/spree_rails_frontend) ruby gem.
2
+
3
+ ## Styling with SASS variables
4
+
5
+ Spree 4 under the hood uses [Bootstrap 4](https://getbootstrap.com/docs/4.6/getting-started/theming/) for easy theming with some additional Spree-specific [SASS variables](https://sass-lang.com/documentation/variables).
6
+
7
+ To make those changes live you need to update SCSS variable files located in your project at `app/assets/stylesheets/spree/frontend/variables/variables.scss`.
8
+
9
+ ### Header
10
+
11
+ _**$header-background**_ - header background color variable with 2 examples: white and blue one. By default, this is set with a _**$primary-background**_ value but you can replace it with any other value in the variables.scss file.
12
+
13
+ _**$header-font-color**_- Header font color. By default set with _**$font-color**_ value but you can replace it with any other value in the variables.scss file.
14
+
15
+ ### Footer
16
+
17
+ _**$footer-background**_ - a variable that overrides $primary-background and allows you to change the footer color. See a white and a blue example below.
18
+
19
+ _**$footer-font-color**_ - a variable that overrides _**$font-color**_ and allows you to change the footer font color. See black and blue font examples below.
20
+
21
+ ### Meganav menu
22
+
23
+ _**$meganav-background**_ - a variable that allows you to change the mega nav menu background color. By default the meganav menu is set to a _**$primary-background**_ value but you can replace it with any other value in the variables.scss file.
24
+
25
+ _**$meganav-font-color**_ - a font color variable in the mega nav menu. By default the mega nav font color is set to a $font-color value but you can replace it with any other value in the variables.scss file.
26
+
27
+ ### Background
28
+
29
+ _**$primary-background**_ - the main background color across the whole site. There are two examples below, of the white and the black backgrounds. Please note that you can also use an image as a background.
30
+
31
+ _**$secondary-background**_ - the second background color present across the whole site with examples attached below.
32
+
33
+ _**$font-color**_ - this variable affects all fonts on the $primary-background. Please see two examples below.
34
+
35
+ _**$secondary-font-color**_ - this affects all fonts on $secondary-background. By default, it is set with a $font-color value but you can replace it with any other value in the variables.scss file.
36
+
37
+ ### Border color
38
+
39
+ _**$global-border-style**_ - this affects the border and separator color throughout the whole site
40
+
41
+ ### Fonts
42
+
43
+ _**$font-family**_ - this sets the font family used across your site. By default, it is in Sans Serif but you can replace it with any other value in the variables.scss file. Check out [these font families](https://websitesetup.org/web-safe-fonts-html-css/) you might use.
44
+
45
+ ### Input fields
46
+
47
+ _**$input-background**_ - this allows you to set a color for all input field backgrounds across the site. See two examples of a white and a yellow backround below.
48
+
49
+ _**$second-global-border**_ - this allows you to set a color for all input field borders across the whole site. See an example below with red input field borders.
50
+
51
+ ### Primary color
52
+
53
+ #### Home page
54
+
55
+ _**$primary-color**_ variable changes
56
+
57
+ * The color of the **SHOP NOW** button on the main hero image
58
+ * The color of the **Summer 2019** text and **READ MORE** button
59
+ * The color of the **NEW COLLECTION** and **SUMMER SALE** headers inside the categories section
60
+
61
+ #### Search results
62
+
63
+ _**$primary-color**_ variable changes
64
+
65
+ * The color of the **No results** icon
66
+
67
+ #### Mega Menu
68
+
69
+ _**$primary-color**_ variable changes
70
+
71
+ * The color of **NEW COLLECTION** and **SUMMER SALE** headers inside the banners
72
+
73
+ #### PDP
74
+
75
+ _**$primary-color**_ variable changes
76
+
77
+ * The color of the **IN STOCK** text
78
+ * The color of the **ADD TO CART** button
79
+
80
+ #### Cart Page
81
+
82
+ _**$primary-color**_ variable changes
83
+
84
+ * The color of the **Trash** delete icon for removing items from the cart
85
+ * The color of the **CHECKOUT** button
86
+
87
+ #### Cart pop-up
88
+
89
+ _**$primary-color**_ variable changes
90
+
91
+ * The color of the **CHECKOUT** and **VIEW CART** buttons
92
+
93
+ #### Cart - empty
94
+
95
+ _**$primary-color**_ variable changes
96
+
97
+ * The color of the **CONTINUE SHOPPING** button
98
+ * The color of the **Empty cart** icon
99
+
100
+ #### Checkout - Registration Step
101
+
102
+ _**$primary-color**_ variable changes
103
+
104
+ * The color of the **LOG IN, SIGN UP** and **CONTINUE AS A GUEST** buttons
105
+
106
+ #### Checkout - Address step
107
+
108
+ _**$primary-color**_ variable changes
109
+
110
+ * The color of the **SAVE AND CONTINUE** button (this element remains the same across the whole checkout process)
111
+ * The color of the **Edit** icon
112
+
113
+ #### Checkout - Payment step
114
+
115
+ _**$primary-color**_ variable changes
116
+
117
+ * The color of the **APPLY** button
118
+
119
+ #### Checkout - Confirm step
120
+
121
+ _**$primary-color**_ variable changes
122
+
123
+ * The color of the **PLACE ORDER** button
124
+
125
+ #### Sign-in page
126
+
127
+ _**$primary-color**_ variable changes
128
+
129
+ The color of the **LOG IN** and **SIGN UP** buttons
130
+
131
+ #### Sign up page
132
+
133
+ _**$primary-color**_ variable changes
134
+
135
+ * The color of the **SIGN UP** and **LOG IN** buttons
136
+
137
+ #### My account page
138
+
139
+ _**$primary-color**_ variable changes
140
+
141
+ * The color of the **Edit** and **Trash** icons
142
+
143
+ #### Edit account page
144
+
145
+ _**$primary-color**_ variable changes
146
+
147
+ * The color of the **UPDATE** button
148
+
149
+ #### Pop-ups
150
+
151
+ _**$primary-color**_ variable changes
152
+
153
+ * The color of the **CANCEL** and **OK** buttons
154
+
155
+ ### Secondary color
156
+
157
+ #### PLP
158
+
159
+ _**$secondary-color**_ variable changes
160
+
161
+ * The color of the chosen **color** border variant
162
+ * The color of the chosen **size** border variant
163
+ * The color of the chosen **length** border variant
164
+ * The color of the chosen **price** border variant
165
+
166
+ #### PDP
167
+
168
+ _**$secondary-color**_ variable changes
169
+
170
+ * The color of the chosen **color** border variant
171
+ * The color of the chosen **size** border variant
172
+ * The color of the chosen **length** border variant
173
+ * The color of the chosen **image** border
174
+
175
+ #### Pop-ups
176
+
177
+ _**$secondary-color**_ variable changes
178
+
179
+ * The color of the **Add to bag successfully** icon
180
+
181
+ Log-in and Sign-in page
182
+
183
+ _**$secondary-color**_ variable changes
184
+
185
+ * The color of the **Remember me** checkbox
186
+ * The color of the **input: focus**
187
+
188
+ #### Checkout
189
+
190
+ _**$secondary-color**_ variable changes
191
+
192
+ * The color of **individual steps** (box, name step, and guideline) - this element remains the same across the whole checkout process
193
+
194
+ #### Checkout - Address step
195
+
196
+ _**$secondary-color**_ variable changes
197
+
198
+ * The color of the **Use shipping address** checkbox
199
+
200
+ #### Checkout - Delivery step
201
+
202
+ _**$secondary-color**_ variable changes
203
+
204
+ * The color of delivery type radio buttons
205
+
206
+ #### Checkout - Payment step
207
+
208
+ _**$secondary-color**_ variable changes
209
+
210
+ * The color of payment type radio buttons
211
+ * The color of payment card radio buttons
212
+
213
+ #### Order confirmation page
214
+
215
+ _**$secondary-color**_ variable changes
216
+
217
+ * The color of the **successful checkmark** icon
218
+
219
+ ### Grid breakpoints
220
+
221
+ [Grid breakpoint variable](https://github.com/spree/spree/blob/main/frontend/app/assets/stylesheets/spree/frontend/variables/bootstrap-overrides.scss) allows you to slightly change element sizes on various devices. These changes are mostly to images and their scale ratio. Feel free to learn more from the [Bootstrap manual](https://getbootstrap.com/docs/4.0/layout/grid/), though we don’t recommend changing these values unless you really need to.
222
+
223
+ ### Rounding for components
224
+
225
+ _**$enable-rounded**_ - Enable rounding for components.
226
+
227
+ Possible values: **true** or **false**
228
+
229
+ **“True” example**
230
+
231
+ **“False” example**
232
+
233
+ ### Shadows for components
234
+
235
+ _**$enable-shadows**_ - Enable shadow for components
236
+
237
+ Possible values: **true** or **false**
238
+
239
+ ### Gradient for components
240
+
241
+ _**$enable-gradients**_ - Enable gradient for components
242
+
243
+ _**$enable-gradients**_ - Enable gradient for components
244
+
245
+ ## Templates
246
+
247
+ ### Importing
248
+
249
+ You can import all templates from spree frontend into your application using this command (in your application root directory):
250
+
251
+ ```bash
252
+ rails g spree:frontend:copy_storefront
253
+ ```
254
+
255
+ All of those views will be added to your `app/views` directory under `spree` folder. You can modify them as you wish.
256
+
257
+ ## Assets
258
+
259
+ ### Spree's Asset Pipeline
260
+
261
+ Spree applications include an `app/assets` directory. We've taken this one step further by subdividing each top level asset directory (images, JavaScript files, stylesheets) into `frontend` and `backend` directories. This is designed to keep assets from the frontend and backend from conflicting with each other.
262
+
263
+ A typical assets directory for a Spree application will look like:
264
+
265
+ ```
266
+ app
267
+ |-- assets
268
+ |-- images
269
+ | |-- spree
270
+ | |-- frontend
271
+ | |-- backend
272
+ |-- javascripts
273
+ | |-- spree
274
+ | |-- frontend
275
+ | | |-- all.js
276
+ | |-- backend
277
+ | |-- all.js
278
+ |-- stylesheets
279
+ | |-- spree
280
+ | |-- frontend
281
+ | | |-- all.css
282
+ | |-- backend
283
+ | |-- all.css
284
+ ```
285
+
286
+ Spree also generates four top level manifests (all.css & all.js, see above) that require all the core extension's and site specific stylesheets / JavaScript files.
287
+
288
+ ### How core extensions (engines) manage assets
289
+
290
+ All core engines have been updated to provide four asset manifests that are responsible for bundling up all the JavaScript files and stylesheets required for that engine.
291
+
292
+ For example, Spree provides the following manifests:
293
+
294
+ ```
295
+ vendor
296
+ |-- assets
297
+ |-- javascripts
298
+ | |-- spree
299
+ | |-- frontend
300
+ | | |-- all.js
301
+ | |-- backend
302
+ | |-- all.js
303
+ |-- stylesheets
304
+ | |-- spree
305
+ | |-- frontend
306
+ | | |-- all.css
307
+ | |-- backend
308
+ | |-- all.css
309
+ ```
310
+
311
+ These manifests are included by default by the relevant all.css or all.js in the host Spree application. For example, `vendor/assets/javascripts/spree/backend/all.js` includes:
312
+
313
+ ```javascript
314
+ //= require spree/backend
315
+
316
+ //= require_tree .
317
+ ```
318
+
319
+ External JavaScript libraries, stylesheets and images have also been relocated into vendor/assets.
320
+
321
+ ### Managing your application's assets
322
+
323
+ Assets that customize your Spree store should go inside the appropriate directories inside `vendor/assets/images/spree`, `vendor/assets/javascripts/spree`, or `vendor/assets/stylesheets/spree`. This is done so that these assets do not interfere with other parts of your application.
324
+
325
+ ### Overriding Spree's assets
326
+
327
+ Overriding or replacing any of Spree's internal assets is even easier than before. It's recommended to attempt to replace as little as possible in a given JavaScript or stylesheet file to help ease future upgrade work required.
328
+
329
+ The methods listed below will work for both applications, extensions and themes with one noticeable difference: Extension & theme asset files will not be automatically included (see above for instructions on how to include asset files from your extensions / themes).
330
+
331
+ ### Overriding individual CSS styles
332
+
333
+ Say for example you want to replace the following CSS snippet:
334
+
335
+ ```css
336
+ /* spree/app/assets/stylesheets/spree/frontend/screen.css */
337
+
338
+ div#footer {
339
+ clear: both;
340
+ }
341
+ ```
342
+
343
+ You can now just create a new stylesheet inside `your_app/vendor/assets/stylesheets/spree/frontend/` and include the following CSS:
344
+
345
+ ```css
346
+ /* vendor/assets/stylesheets/spree/frontend/foo.css */
347
+
348
+ div#footer {
349
+ clear: none;
350
+ border: 1px solid red;
351
+ }
352
+ ```
353
+
354
+ The `frontend/all.css` manifest will automatically include `foo.css` and it will actually include both definitions with the one from `foo.css` being included last, hence it will be the rule applied.
355
+
356
+ ### Overriding entire CSS files
357
+
358
+ To replace an entire stylesheet as provided by Spree you simply need to create a file with the same name and save it to the corresponding path within your application's or extension's `vendor/assets/stylesheets` directory.
359
+
360
+ For example, to replace `spree/frontend/all.css` you would save the replacement to `your_app/vendor/assets/stylesheets/spree/frontend/all.css`.
361
+
362
+ This same method can also be used to override stylesheets provided by third-party extensions.
363
+
364
+ ### Overriding individual JavaScript functions
365
+
366
+ A similar approach can be used for JavaScript functions. For example, if you wanted to override the `show_variant_images` method:
367
+
368
+ ```javascript
369
+ // spree/app/assets/javascripts/spree/frontend/product.js
370
+
371
+ var show_variant_images = function(variant_id) {
372
+ $('li.vtmb').hide();
373
+ $('li.vtmb-' + variant_id).show();
374
+ var currentThumb = $('#' +
375
+ $("#main-image").data('selectedThumbId'));
376
+
377
+ // if currently selected thumb does not belong to current variant,
378
+ // nor to common images,
379
+ // hide it and select the first available thumb instead.
380
+
381
+ if(!currentThumb.hasClass('vtmb-' + variant_id) &&
382
+ !currentThumb.hasClass('tmb-all')) {
383
+ var thumb = $($('ul.thumbnails li:visible').eq(0));
384
+ var newImg = thumb.find('a').attr('href');
385
+ $('ul.thumbnails li').removeClass('selected');
386
+ thumb.addClass('selected');
387
+ $('#main-image img').attr('src', newImg);
388
+ $("#main-image").data('selectedThumb', newImg);
389
+ $("#main-image").data('selectedThumbId', thumb.attr('id'));
390
+ }
391
+ }
392
+ ```
393
+
394
+ Again, just create a new JavaScript file inside `your_app/vendor/assets/javascripts/spree/frontend` and include the new method definition:
395
+
396
+ ```javascript
397
+ // your_app/vendor/assets/javascripts/spree/frontend/foo.js
398
+
399
+ var show_variant_images = function(variant_id) {
400
+ alert('hello world');
401
+ }
402
+ ```
403
+
404
+ The resulting `frontend/all.js` would include both methods, with the latter being the one executed on request.
405
+
406
+ ### Overriding entire JavaScript files
407
+
408
+ To replace an entire JavaScript file as provided by Spree you simply need to create a file with the same name and save it to the corresponding path within your application's or extension's `app/assets/javascripts` directory.
409
+
410
+ For example, to replace `spree/frontend/all.js` you would save the replacement to `your_app/vendor/assets/javascripts/spree/frontend/all.js`.
411
+
412
+ This same method can be used to override JavaScript files provided by third-party extensions.
413
+
414
+ ## SEO recommendations
415
+
416
+ ### Sitemap
417
+
418
+ We highly recommend adding a sitemap to your site. It might affect how Google bot crawls your store pages. There is an official extension called [Spree Sitemap](https://github.com/spree-contrib/spree_sitemap) for that exact purpose.
419
+
420
+ 1. Per region, language or currency
421
+ 2. Click the **Edit** button (indicated with a pencil icon) for the right store
422
+ 3. Enter a title, keywords, and description values for the store homepage
423
+ 4. Click the **Update** button at the bottom of the page
424
+
425
+ To set the title, meta keywords, and description for each store **category page (PLP)**, in the admin panel:
426
+
427
+ 1. Go to **Products > Taxonomies**
428
+ 2. Go into the Categories list by pressing the **Edit** button (pencil icon)
429
+ 3. Pick the category you’d like to edit by right-clicking (control + click on a Mac) a child in the tree to access the menu for adding, deleting or sorting a child.
430
+ 4. Click the **Edit** link for that category
431
+ 5. Replace the default values for title, meta keywords, and description with your own
432
+ 6. Click the **Update** button at the bottom of the page
433
+
434
+ You’ll have to edit every category and subcategory to your liking in a similar fashion.
435
+
436
+ To set the title, meta keywords and description for each **product page (PDP)**, in the admin panel:
437
+
438
+ 1. Go to **Products > Products**
439
+ 2. In the product list pick the right one by pressing the **Edit** button (pencil icon)
440
+ 3. While in the Details tab, scroll down and input your values for the title, meta keywords, and description
441
+ 4. Click the **Update** button at the bottom of the page
442
+
443
+ ### Social sharing and search preview
444
+
445
+ The new Spree UX has the following social sharing features implemented:
446
+
447
+ * Facebook sharing with [Open Graph tags](https://ogp.me/) to enable an attractive page preview
448
+ * Google visibility with structured data using [Schema.org](http://schema.org/) with [JSON-DL](https://json-ld.org/)
449
+
450
+ Feel free to [test the Open Graph tags implementation](https://developers.facebook.com/tools/debug/) and the also [test the Schema.org implementation](https://search.google.com/structured-data/testing-tool/u/0/) for your store.
@@ -0,0 +1,87 @@
1
+ ---
2
+ title: Assets
3
+ ---
4
+
5
+ By default, files are stored on the local filesystem. For production, use a cloud storage service.
6
+
7
+ Spree auto-detects the storage provider based on which environment variables are set — no code changes needed. See [Environment Variables](/developer/deployment/environment_variables#file-storage-s3--cloudflare-r2) for the full list.
8
+
9
+ ## AWS S3
10
+
11
+ Set the following environment variables:
12
+
13
+ | Variable | Default | Description |
14
+ | --- | --- | --- |
15
+ | `AWS_ACCESS_KEY_ID` | — | AWS access key |
16
+ | `AWS_SECRET_ACCESS_KEY` | — | AWS secret key |
17
+ | `AWS_REGION` | — | AWS region (e.g., `us-east-1`) |
18
+ | `AWS_BUCKET` | `spree-production` | S3 bucket name |
19
+
20
+ ### CORS Configuration
21
+
22
+ The Admin Dashboard uses direct uploads. Configure CORS on your S3 bucket to allow this:
23
+
24
+ 1. Go to your S3 bucket in AWS Console
25
+ 2. Click on "Permissions" tab
26
+ 3. Scroll down to "Cross-origin resource sharing (CORS)"
27
+ 4. Click "Edit" and paste the following configuration:
28
+
29
+ ```json
30
+ [
31
+ {
32
+ "AllowedMethods": ["GET", "PUT", "POST"],
33
+ "AllowedOrigins": ["https://myspreestore.com"],
34
+ "AllowedHeaders": ["*"],
35
+ "ExposeHeaders": ["ETag"]
36
+ }
37
+ ]
38
+ ```
39
+
40
+ > **INFO:** Replace `myspreestore.com` with the domain you use to access your Spree Admin Dashboard.
41
+
42
+ ## Cloudflare R2
43
+
44
+ Cloudflare R2 is S3-compatible object storage with zero egress fees and a built-in CDN.
45
+
46
+ Set the following environment variables:
47
+
48
+ | Variable | Default | Description |
49
+ | --- | --- | --- |
50
+ | `CLOUDFLARE_ENDPOINT` | — | R2 endpoint URL |
51
+ | `CLOUDFLARE_ACCESS_KEY_ID` | — | R2 access key |
52
+ | `CLOUDFLARE_SECRET_ACCESS_KEY` | — | R2 secret key |
53
+ | `CLOUDFLARE_BUCKET` | `spree-production` | R2 bucket name |
54
+
55
+ ### CORS Configuration
56
+
57
+ Configure CORS on your R2 bucket for direct uploads:
58
+
59
+ 1. Go to your R2 bucket in Cloudflare Console
60
+ 2. Click on "Settings" tab
61
+ 3. Scroll down to "CORS policy"
62
+ 4. Click "Edit CORS policy" and paste the following configuration:
63
+
64
+ ```json
65
+ [
66
+ {
67
+ "AllowedOrigins": [
68
+ "https://myspreestore.com"
69
+ ],
70
+ "AllowedMethods": [
71
+ "PUT"
72
+ ],
73
+ "AllowedHeaders": [
74
+ "*"
75
+ ],
76
+ "ExposeHeaders": [
77
+ "Origin",
78
+ "Content-Type",
79
+ "Content-MD5",
80
+ "Content-Disposition"
81
+ ],
82
+ "MaxAgeSeconds": 3600
83
+ }
84
+ ]
85
+ ```
86
+
87
+ > **INFO:** Replace `myspreestore.com` with the domain you use to access your Spree Admin Dashboard.