@spree/docs 0.1.0 → 0.1.2
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.
- package/dist/api-reference/store-api/errors.md +2 -2
- package/dist/api-reference/store-api/idempotency.md +1 -1
- package/dist/api-reference/store-api/localization.md +4 -4
- package/dist/api-reference/store-api/metadata.md +2 -2
- package/dist/api-reference/store.yaml +10599 -0
- package/dist/api-reference/storefront/authentication.md +2 -2
- package/dist/api-reference/tutorials/adyen-integration-guide-for-android.md +2 -2
- package/dist/api-reference/tutorials/adyen-integration-guide-for-ios.md +2 -2
- package/dist/api-reference/tutorials/quick-checkout-with-stripe.md +8 -8
- package/dist/api-reference/v2/introduction.md +2 -2
- package/dist/api-reference/webhooks-events.md +2 -2
- package/dist/developer/admin/admin.md +18 -18
- package/dist/developer/admin/components.md +1 -1
- package/dist/developer/admin/extending-ui.md +26 -26
- package/dist/developer/admin/helper-methods.md +2 -2
- package/dist/developer/admin/navigation.md +5 -5
- package/dist/developer/admin/tables.md +4 -4
- package/dist/developer/cli/quickstart.md +2 -2
- package/dist/developer/contributing/creating-an-extension.md +12 -12
- package/dist/developer/contributing/quickstart.md +1 -1
- package/dist/developer/core-concepts/addresses.md +11 -11
- package/dist/developer/core-concepts/adjustments.md +8 -8
- package/dist/developer/core-concepts/architecture.md +21 -21
- package/dist/developer/core-concepts/calculators.md +4 -4
- package/dist/developer/core-concepts/customers.md +9 -9
- package/dist/developer/core-concepts/events.md +5 -5
- package/dist/developer/core-concepts/inventory.md +5 -5
- package/dist/developer/core-concepts/markets.md +10 -10
- package/dist/developer/core-concepts/media.md +3 -3
- package/dist/developer/core-concepts/metafields.md +6 -6
- package/dist/developer/core-concepts/orders.md +14 -14
- package/dist/developer/core-concepts/payments.md +9 -9
- package/dist/developer/core-concepts/pricing.md +10 -10
- package/dist/developer/core-concepts/products.md +10 -10
- package/dist/developer/core-concepts/promotions.md +5 -5
- package/dist/developer/core-concepts/reports.md +2 -2
- package/dist/developer/core-concepts/search-filtering.md +7 -7
- package/dist/developer/core-concepts/shipments.md +13 -13
- package/dist/developer/core-concepts/slugs.md +3 -3
- package/dist/developer/core-concepts/staff-roles.md +7 -7
- package/dist/developer/core-concepts/store-credits-gift-cards.md +4 -4
- package/dist/developer/core-concepts/stores.md +15 -15
- package/dist/developer/core-concepts/taxes.md +11 -11
- package/dist/developer/core-concepts/translations.md +6 -6
- package/dist/developer/core-concepts/users.md +12 -12
- package/dist/developer/core-concepts/webhooks.md +8 -8
- package/dist/developer/create-spree-app/quickstart.md +5 -5
- package/dist/developer/customization/api.md +2 -2
- package/dist/developer/customization/authentication.md +2 -2
- package/dist/developer/customization/checkout.md +7 -7
- package/dist/developer/customization/decorators.md +24 -24
- package/dist/developer/customization/dependencies.md +1 -1
- package/dist/developer/customization/metadata.md +3 -3
- package/dist/developer/customization/permissions.md +1 -1
- package/dist/developer/customization/quickstart.md +9 -9
- package/dist/developer/customization/v4/checkout.md +3 -3
- package/dist/developer/customization/v4/deface.md +1 -1
- package/dist/developer/deployment/assets.md +1 -1
- package/dist/developer/deployment/aws.md +5 -5
- package/dist/developer/deployment/docker.md +2 -2
- package/dist/developer/deployment/environment_variables.md +1 -1
- package/dist/developer/deployment/render.md +5 -5
- package/dist/developer/getting-started/quickstart.md +2 -2
- package/dist/developer/how-to/custom-payment-method.md +6 -6
- package/dist/developer/how-to/custom-promotion.md +7 -7
- package/dist/developer/how-to/custom-report.md +3 -3
- package/dist/developer/how-to/custom-search-provider.md +7 -7
- package/dist/developer/multi-store/quickstart.md +1 -1
- package/dist/developer/multi-tenant/quickstart.md +1 -1
- package/dist/developer/sdk/authentication.md +1 -1
- package/dist/developer/sdk/configuration.md +1 -1
- package/dist/developer/sdk/store/markets.md +3 -3
- package/dist/developer/storefront/nextjs/customization.md +1 -1
- package/dist/developer/storefront/nextjs/quickstart.md +2 -2
- package/dist/developer/tutorial/admin.md +2 -2
- package/dist/developer/tutorial/extending-models.md +15 -15
- package/dist/developer/tutorial/file-uploads.md +1 -1
- package/dist/developer/tutorial/introduction.md +7 -7
- package/dist/developer/tutorial/rich-text.md +1 -1
- package/dist/developer/tutorial/testing.md +5 -61
- package/dist/developer/upgrades/3.7-to-4.0.md +1 -1
- package/dist/developer/upgrades/4.0-to-4.1.md +1 -1
- package/dist/developer/upgrades/4.10-to-5.0.md +1 -1
- package/dist/developer/upgrades/4.5-to-4.6.md +4 -4
- package/dist/developer/upgrades/4.8-to-4.9.md +1 -1
- package/dist/developer/upgrades/4.9-to-4.10.md +1 -1
- package/dist/developer/upgrades/5.0-to-5.1.md +1 -1
- package/dist/developer/upgrades/5.1-to-5.2.md +2 -2
- package/dist/developer/upgrades/5.2-to-5.3.md +2 -2
- package/dist/developer/upgrades/5.3-to-5.4.md +5 -5
- package/dist/developer/upgrades/quickstart.md +1 -1
- package/dist/integrations/integrations.md +10 -10
- package/dist/integrations/payments/adyen.md +1 -1
- package/dist/integrations/search/meilisearch.md +2 -2
- package/package.json +7 -2
- package/dist/developer/storefront/blocks.md +0 -285
- package/dist/developer/storefront/custom-css.md +0 -260
- package/dist/developer/storefront/custom-javascript.md +0 -166
- package/dist/developer/storefront/helper-methods.md +0 -1288
- package/dist/developer/storefront/links.md +0 -298
- package/dist/developer/storefront/pages.md +0 -163
- package/dist/developer/storefront/sections.md +0 -569
- package/dist/developer/storefront/storefront.md +0 -56
- package/dist/developer/storefront/themes.md +0 -161
- package/dist/developer/tutorial/page-builder.md +0 -487
- package/dist/developer/tutorial/seo.md +0 -332
- package/dist/developer/tutorial/storefront.md +0 -352
|
@@ -40,7 +40,7 @@ If you want a list of all the currently available states for the checkout, use t
|
|
|
40
40
|
|
|
41
41
|
## Default Checkout Steps
|
|
42
42
|
|
|
43
|
-
The Spree checkout process consists of the following steps. With the exception of the Registration step, each of these steps corresponds to a state of the [Order object](
|
|
43
|
+
The Spree checkout process consists of the following steps. With the exception of the Registration step, each of these steps corresponds to a state of the [Order object](../core-concepts/orders.md):
|
|
44
44
|
|
|
45
45
|
* Shipping Address and Contact Information
|
|
46
46
|
* Delivery Options Shipping Method
|
|
@@ -55,7 +55,7 @@ This step allows the customer to add shipping information and contact informatio
|
|
|
55
55
|
|
|
56
56
|
The address fields include a select box for choosing state/province. If there are no states configured for a particular country, the select box will be replaced by a text field instead.
|
|
57
57
|
|
|
58
|
-
The list of countries that appear in the country select box can also be configured. Spree will list all countries by default, but you can configure exactly which countries you would like to appear. The list can be limited to a specific set of countries by [setting the Store's checkout zone](
|
|
58
|
+
The list of countries that appear in the country select box can also be configured. Spree will list all countries by default, but you can configure exactly which countries you would like to appear. The list can be limited to a specific set of countries by [setting the Store's checkout zone](../core-concepts/stores.md#checkout-configuration).
|
|
59
59
|
|
|
60
60
|
### Delivery Options
|
|
61
61
|
|
|
@@ -67,7 +67,7 @@ This step is where the customer provides payment and billing information. Spree
|
|
|
67
67
|
|
|
68
68
|
Besides Credit Card, Wallets and other 3rd party payment methods, Spree also supports Store Credit and Gift Cards (Spree 5.1+ only) which can be used to pay for the entire order or part of the order.
|
|
69
69
|
|
|
70
|
-
For more information about payments, please see the [Payments guide](
|
|
70
|
+
For more information about payments, please see the [Payments guide](../core-concepts/payments.md).
|
|
71
71
|
|
|
72
72
|
### Confirmation
|
|
73
73
|
|
|
@@ -81,7 +81,7 @@ This step is disabled by default, but can be enabled by two ways:
|
|
|
81
81
|
Spree::Config[:always_include_confirm_step] = true
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
2. conditionally for specific orders by overriding the `confirmation_required?` method in `Spree::Order` with a [decorator](
|
|
84
|
+
2. conditionally for specific orders by overriding the `confirmation_required?` method in `Spree::Order` with a [decorator](decorators.md), eg.
|
|
85
85
|
|
|
86
86
|
```ruby app/models/spree/order_decorator.rb
|
|
87
87
|
module Spree
|
|
@@ -100,7 +100,7 @@ There are two approaches for adding logic around checkout state transitions:
|
|
|
100
100
|
|
|
101
101
|
### Approach 1: Events Subscribers (Recommended for side effects)
|
|
102
102
|
|
|
103
|
-
For actions that should happen **after** a checkout step completes (syncing with external services, sending notifications, logging, etc.), use [Events subscribers](
|
|
103
|
+
For actions that should happen **after** a checkout step completes (syncing with external services, sending notifications, logging, etc.), use [Events subscribers](../core-concepts/events.md). This is the recommended approach because it keeps your code decoupled from Spree internals.
|
|
104
104
|
|
|
105
105
|
```ruby app/subscribers/my_app/order_completed_subscriber.rb
|
|
106
106
|
module MyApp
|
|
@@ -119,7 +119,7 @@ module MyApp
|
|
|
119
119
|
end
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
> **INFO:** Events are fired automatically when orders change state. See [Events documentation](
|
|
122
|
+
> **INFO:** Events are fired automatically when orders change state. See [Events documentation](../core-concepts/events.md#order-events) for all available order events.
|
|
123
123
|
|
|
124
124
|
### Approach 2: State Machine Callbacks (For validation/blocking logic)
|
|
125
125
|
|
|
@@ -146,7 +146,7 @@ end
|
|
|
146
146
|
|
|
147
147
|
This callback would prevent transitioning to the `delivery` step if `valid_zip_code?` returns false.
|
|
148
148
|
|
|
149
|
-
> **WARNING:** Avoid using state machine callbacks for side effects like API calls or notifications. These can slow down checkout and may fail silently. Use [Events subscribers](
|
|
149
|
+
> **WARNING:** Avoid using state machine callbacks for side effects like API calls or notifications. These can slow down checkout and may fail silently. Use [Events subscribers](../core-concepts/events.md) instead.
|
|
150
150
|
|
|
151
151
|
## Modifying the checkout flow
|
|
152
152
|
|
|
@@ -5,13 +5,13 @@ description: Decorators allow you to add or modify behavior of Spree classes in
|
|
|
5
5
|
|
|
6
6
|
> **WARNING:** **Decorators should be a last resort.** They tightly couple your code to Spree internals and can break during upgrades. Before using decorators, consider these modern alternatives that are safer and easier to maintain:
|
|
7
7
|
>
|
|
8
|
-
> - **[Events & Subscribers](
|
|
9
|
-
> - **[Webhooks](
|
|
10
|
-
> - **[Dependencies](
|
|
11
|
-
> - **[Admin Navigation](
|
|
12
|
-
> - **[Admin Partials](
|
|
13
|
-
> - **[Admin Tables](
|
|
14
|
-
> - **[Ransack Configuration](
|
|
8
|
+
> - **[Events & Subscribers](../core-concepts/events.md)** - For reacting to model changes (after save, create, update, delete)
|
|
9
|
+
> - **[Webhooks](../core-concepts/webhooks.md)** - For notifying external services when events occur
|
|
10
|
+
> - **[Dependencies](dependencies.md)** - For swapping out services, serializers, and abilities
|
|
11
|
+
> - **[Admin Navigation](../admin/navigation.md)** - For adding menu items without controller decorators
|
|
12
|
+
> - **[Admin Partials](../admin/extending-ui.md)** - For extending admin UI without view decorators
|
|
13
|
+
> - **[Admin Tables](../admin/tables.md)** - For customizing admin list views
|
|
14
|
+
> - **[Ransack Configuration](../core-concepts/search-filtering.md#extending-ransackable-configuration)** - For adding searchable/sortable fields without model decorators
|
|
15
15
|
|
|
16
16
|
## When to Use Decorators vs Modern Alternatives
|
|
17
17
|
|
|
@@ -19,13 +19,13 @@ Before reaching for a decorator, check if your use case is better served by a mo
|
|
|
19
19
|
|
|
20
20
|
| Use Case | Instead of Decorator | Use This |
|
|
21
21
|
|----------|---------------------|----------|
|
|
22
|
-
| After-save hooks (sync to external service) | Model decorator with `after_save` | [Events subscriber](
|
|
23
|
-
| Notify external service on changes | Model decorator with callbacks | [Webhooks](
|
|
24
|
-
| Custom add-to-cart logic | Service decorator | [Dependencies injection](
|
|
25
|
-
| Custom API responses | Serializer decorator | [Dependencies injection](
|
|
26
|
-
| Add admin menu item | Controller decorator | [Admin Navigation API](
|
|
27
|
-
| Add section to admin form | View decorator/override | [Admin Partials injection](
|
|
28
|
-
| Add searchable/filterable field | Model decorator with `ransackable_attributes` | [Ransack configuration](
|
|
22
|
+
| After-save hooks (sync to external service) | Model decorator with `after_save` | [Events subscriber](../core-concepts/events.md) |
|
|
23
|
+
| Notify external service on changes | Model decorator with callbacks | [Webhooks](../core-concepts/webhooks.md) |
|
|
24
|
+
| Custom add-to-cart logic | Service decorator | [Dependencies injection](dependencies.md) |
|
|
25
|
+
| Custom API responses | Serializer decorator | [Dependencies injection](dependencies.md) |
|
|
26
|
+
| Add admin menu item | Controller decorator | [Admin Navigation API](../admin/navigation.md) |
|
|
27
|
+
| Add section to admin form | View decorator/override | [Admin Partials injection](../admin/extending-ui.md) |
|
|
28
|
+
| Add searchable/filterable field | Model decorator with `ransackable_attributes` | [Ransack configuration](../core-concepts/search-filtering.md#extending-ransackable-configuration) |
|
|
29
29
|
| Add association to core model | - | Decorator (still appropriate) |
|
|
30
30
|
| Add validation to core model | - | Decorator (still appropriate) |
|
|
31
31
|
| Add new method to core model | - | Decorator (still appropriate) |
|
|
@@ -316,7 +316,7 @@ end
|
|
|
316
316
|
|
|
317
317
|
### Modifying Existing Actions
|
|
318
318
|
|
|
319
|
-
> **WARNING:** **High risk of breaking during upgrades.** When you override an existing Spree action, your code depends on Spree's internal implementation details. If Spree changes the action's behavior, instance variables, or method signatures in a future version, your decorator may silently break or cause unexpected bugs. Use [Events](
|
|
319
|
+
> **WARNING:** **High risk of breaking during upgrades.** When you override an existing Spree action, your code depends on Spree's internal implementation details. If Spree changes the action's behavior, instance variables, or method signatures in a future version, your decorator may silently break or cause unexpected bugs. Use [Events](../core-concepts/events.md) for post-action side effects instead.
|
|
320
320
|
|
|
321
321
|
```ruby app/controllers/spree/admin/products_controller_decorator.rb
|
|
322
322
|
module Spree
|
|
@@ -349,7 +349,7 @@ module Spree
|
|
|
349
349
|
end
|
|
350
350
|
```
|
|
351
351
|
|
|
352
|
-
> **INFO:** **Better alternative:** For post-action side effects like notifications, use [Events subscribers](
|
|
352
|
+
> **INFO:** **Better alternative:** For post-action side effects like notifications, use [Events subscribers](../core-concepts/events.md) instead. Subscribe to `product.created` to be notified when products are created, without coupling to controller internals.
|
|
353
353
|
|
|
354
354
|
### Adding Before Actions
|
|
355
355
|
|
|
@@ -513,11 +513,11 @@ end
|
|
|
513
513
|
|
|
514
514
|
## Related Documentation
|
|
515
515
|
|
|
516
|
-
- [Events](
|
|
517
|
-
- [Webhooks](
|
|
518
|
-
- [Dependencies](
|
|
519
|
-
- [Admin Navigation](
|
|
520
|
-
- [Admin Partials](
|
|
521
|
-
- [Extending Core Models Tutorial](
|
|
522
|
-
- [Customization Overview](
|
|
523
|
-
- [Logic Customization](
|
|
516
|
+
- [Events](../core-concepts/events.md) - Learn about Spree's event system
|
|
517
|
+
- [Webhooks](../core-concepts/webhooks.md) - HTTP callbacks for external integrations
|
|
518
|
+
- [Dependencies](dependencies.md) - Swap core services with your own
|
|
519
|
+
- [Admin Navigation](../admin/navigation.md) - Extend admin menu without decorators
|
|
520
|
+
- [Admin Partials](../admin/extending-ui.md) - Extend admin UI without view decorators
|
|
521
|
+
- [Extending Core Models Tutorial](../tutorial/extending-models.md) - Step-by-step guide to connecting custom models with Spree core
|
|
522
|
+
- [Customization Overview](quickstart.md) - General customization patterns
|
|
523
|
+
- [Logic Customization](logic.md) - Customizing business logic
|
|
@@ -73,7 +73,7 @@ Spree.api.storefront_cart_serializer.new(order).serializable_hash
|
|
|
73
73
|
|
|
74
74
|
## Controller level customization
|
|
75
75
|
|
|
76
|
-
If you need to replace [serializers](https://github.com/jsonapi-serializer/jsonapi-serializer) or Services in a specific API endpoint you can create a [code decorator](
|
|
76
|
+
If you need to replace [serializers](https://github.com/jsonapi-serializer/jsonapi-serializer) or Services in a specific API endpoint you can create a [code decorator](decorators.md):
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
79
|
mkdir -p app/controllers/spree && touch app/controllers/spree/cart_controller_decorator.rb
|
|
@@ -8,7 +8,7 @@ Metadata provides simple, unstructured key-value storage on Spree resources —
|
|
|
8
8
|
|
|
9
9
|
Metadata is **write-only** in the Store API — you can set it when creating or updating resources, but it is never returned in Store API responses. It is visible in Admin API responses for administrative use.
|
|
10
10
|
|
|
11
|
-
> **INFO:** For structured, type-safe custom attributes with admin UI support, use [Metafields](
|
|
11
|
+
> **INFO:** For structured, type-safe custom attributes with admin UI support, use [Metafields](../core-concepts/metafields.md) instead.
|
|
12
12
|
|
|
13
13
|
## Store API
|
|
14
14
|
|
|
@@ -188,7 +188,7 @@ Metadata updates use **merge semantics** — existing keys are preserved, new ke
|
|
|
188
188
|
|
|
189
189
|
## Metadata vs Metafields
|
|
190
190
|
|
|
191
|
-
| | Metadata | [Metafields](
|
|
191
|
+
| | Metadata | [Metafields](../core-concepts/metafields.md) |
|
|
192
192
|
|---|---|---|
|
|
193
193
|
| **Use case** | Integration data, tracking, simple key-value | Structured custom attributes with admin UI |
|
|
194
194
|
| **Validation** | None | Type-specific (text, number, boolean, JSON) |
|
|
@@ -222,7 +222,7 @@ The Store API currently supports writing metadata on:
|
|
|
222
222
|
|
|
223
223
|
## Migration from public_metadata
|
|
224
224
|
|
|
225
|
-
The `public_metadata` column is deprecated. Metadata is no longer returned in Store API responses. If you were using `public_metadata` for data that needs to be visible to customers, migrate to [Metafields](
|
|
225
|
+
The `public_metadata` column is deprecated. Metadata is no longer returned in Store API responses. If you were using `public_metadata` for data that needs to be visible to customers, migrate to [Metafields](../core-concepts/metafields.md) with `display_on: 'both'`.
|
|
226
226
|
|
|
227
227
|
```ruby
|
|
228
228
|
# Before (deprecated)
|
|
@@ -206,7 +206,7 @@ end
|
|
|
206
206
|
|
|
207
207
|
### Replacing the Ability Class
|
|
208
208
|
|
|
209
|
-
You can replace the entire ability class via [Dependencies](
|
|
209
|
+
You can replace the entire ability class via [Dependencies](dependencies.md):
|
|
210
210
|
|
|
211
211
|
```ruby
|
|
212
212
|
# config/initializers/spree.rb
|
|
@@ -42,7 +42,7 @@ Spree is a flexible platform allowing you to customize every part of it to suit
|
|
|
42
42
|
end
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Please see [Configuration](
|
|
45
|
+
Please see [Configuration](configuration.md) section for more information.
|
|
46
46
|
|
|
47
47
|
</details>
|
|
48
48
|
|
|
@@ -77,7 +77,7 @@ Spree is a flexible platform allowing you to customize every part of it to suit
|
|
|
77
77
|
- Async by default - keeps requests fast
|
|
78
78
|
- Easier testing and upgrades
|
|
79
79
|
|
|
80
|
-
Please see [Events](
|
|
80
|
+
Please see [Events](../core-concepts/events.md) section for more information.
|
|
81
81
|
|
|
82
82
|
</details>
|
|
83
83
|
|
|
@@ -95,7 +95,7 @@ Spree is a flexible platform allowing you to customize every part of it to suit
|
|
|
95
95
|
|
|
96
96
|
Configure webhooks in **Admin > Developers > Webhooks** or via the API.
|
|
97
97
|
|
|
98
|
-
Please see [Webhooks](
|
|
98
|
+
Please see [Webhooks](../core-concepts/webhooks.md) section for more information.
|
|
99
99
|
|
|
100
100
|
</details>
|
|
101
101
|
|
|
@@ -143,9 +143,9 @@ Spree is a flexible platform allowing you to customize every part of it to suit
|
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
Please see:
|
|
146
|
-
- [Admin Navigation](
|
|
147
|
-
- [Admin Partials](
|
|
148
|
-
- [Admin Tables](
|
|
146
|
+
- [Admin Navigation](../admin/navigation.md) - For adding menu items
|
|
147
|
+
- [Admin Partials](../admin/extending-ui.md) - For extending UI
|
|
148
|
+
- [Admin Tables](../admin/tables.md) - For customizing list views
|
|
149
149
|
|
|
150
150
|
</details>
|
|
151
151
|
|
|
@@ -162,7 +162,7 @@ Spree is a flexible platform allowing you to customize every part of it to suit
|
|
|
162
162
|
Spree.ransack.add_association :product, :brand
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
Please see [Search & Filtering](
|
|
165
|
+
Please see [Search & Filtering](../core-concepts/search-filtering.md#extending-ransackable-configuration) section for more information.
|
|
166
166
|
|
|
167
167
|
</details>
|
|
168
168
|
|
|
@@ -199,8 +199,8 @@ Spree is a flexible platform allowing you to customize every part of it to suit
|
|
|
199
199
|
> **WARNING:** Decorators should be used **only when no other option works**. They tightly couple your code to Spree internals and can break during upgrades.
|
|
200
200
|
>
|
|
201
201
|
> **Do NOT use decorators for:**
|
|
202
|
-
> - After-save callbacks → Use [Events](
|
|
203
|
-
> - External service sync → Use [Webhooks](
|
|
202
|
+
> - After-save callbacks → Use [Events](../core-concepts/events.md) instead
|
|
203
|
+
> - External service sync → Use [Webhooks](../core-concepts/webhooks.md) instead
|
|
204
204
|
> - Custom service logic → Use [Dependencies](dependencies) instead
|
|
205
205
|
> - Admin UI changes → Use [Admin Extensions](#admin-extensions) instead
|
|
206
206
|
|
|
@@ -40,7 +40,7 @@ If you want a list of all the currently available states for the checkout, use t
|
|
|
40
40
|
|
|
41
41
|
## Default Checkout Steps
|
|
42
42
|
|
|
43
|
-
The Spree checkout process consists of the following steps. With the exception of the Registration step, each of these steps corresponds to a state of the [Order object](
|
|
43
|
+
The Spree checkout process consists of the following steps. With the exception of the Registration step, each of these steps corresponds to a state of the [Order object](../../core-concepts/orders.md):
|
|
44
44
|
|
|
45
45
|
* Registration Optional - only if using [spree_auth_devise](https://github.com/spree/spree_auth_devise) extension, can be toggled through the `Spree::Auth::Config[:registration_step]` configuration setting
|
|
46
46
|
* Address Information
|
|
@@ -87,7 +87,7 @@ This step allows the customer to add both their billing and shipping information
|
|
|
87
87
|
|
|
88
88
|
The address fields include a select box for choosing state/province. If there are no states configured for a particular country, the select box will be replaced by a text field instead.
|
|
89
89
|
|
|
90
|
-
The list of countries that appear in the country select box can also be configured. Spree will list all countries by default, but you can configure exactly which countries you would like to appear. The list can be limited to a specific set of countries by [setting the Store's checkout zone](
|
|
90
|
+
The list of countries that appear in the country select box can also be configured. Spree will list all countries by default, but you can configure exactly which countries you would like to appear. The list can be limited to a specific set of countries by [setting the Store's checkout zone](../../core-concepts/stores.md#checkout-configuration). Spree assumes that the list of billing and shipping countries will be the same. You can always change this logic via class decorator if this does not suit your needs.
|
|
91
91
|
|
|
92
92
|
### Delivery Options
|
|
93
93
|
|
|
@@ -105,7 +105,7 @@ If you do not want to use a gateway with payment profiles then you will need to
|
|
|
105
105
|
|
|
106
106
|
Spree discards the credit card number after this step is processed. If you do not have a gateway with payment profiles enabled then your card information will be lost before it's time to authorize the card.
|
|
107
107
|
|
|
108
|
-
For more information about payments, please see the [Payments guide](
|
|
108
|
+
For more information about payments, please see the [Payments guide](../../core-concepts/payments.md).
|
|
109
109
|
|
|
110
110
|
### Confirmation
|
|
111
111
|
|
|
@@ -67,7 +67,7 @@ module Spree
|
|
|
67
67
|
end
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
Now, when we head to `http://localhost:3000/admin/products` and edit a product, we should be able to set a sale price for the product and be able to view it on our sale page, `http://localhost:3000/sale`. Note that you will likely need to restart our example Spree application created in the [Getting Started tutorial](
|
|
70
|
+
Now, when we head to `http://localhost:3000/admin/products` and edit a product, we should be able to set a sale price for the product and be able to view it on our sale page, `http://localhost:3000/sale`. Note that you will likely need to restart our example Spree application created in the [Getting Started tutorial](../../getting-started/quickstart.md).
|
|
71
71
|
|
|
72
72
|
### Available actions
|
|
73
73
|
|
|
@@ -4,7 +4,7 @@ title: Assets
|
|
|
4
4
|
|
|
5
5
|
By default, files are stored on the local filesystem. For production, use a cloud storage service.
|
|
6
6
|
|
|
7
|
-
Spree auto-detects the storage provider based on which environment variables are set — no code changes needed. See [Environment Variables](
|
|
7
|
+
Spree auto-detects the storage provider based on which environment variables are set — no code changes needed. See [Environment Variables](environment_variables.md#file-storage-s3--cloudflare-r2) for the full list.
|
|
8
8
|
|
|
9
9
|
## AWS S3
|
|
10
10
|
|
|
@@ -5,7 +5,7 @@ description: Learn how to deploy your Spree application on Amazon Web Services (
|
|
|
5
5
|
|
|
6
6
|
Amazon Web Services offers reliable, scalable, and inexpensive cloud computing services. AWS is also one of the most popular choices for hosting a Spree application.
|
|
7
7
|
|
|
8
|
-
We recommend using AWS ECS Fargate to host your Spree application via [Docker image](
|
|
8
|
+
We recommend using AWS ECS Fargate to host your Spree application via [Docker image](docker.md).
|
|
9
9
|
|
|
10
10
|
## Required AWS services
|
|
11
11
|
|
|
@@ -15,8 +15,8 @@ To fully run your Spree application on AWS, you will need the following services
|
|
|
15
15
|
|---------|-------------|
|
|
16
16
|
| [AWS ECS Fargate](https://aws.amazon.com/fargate/) | Amazon Elastic Container Service (ECS) is a fully managed container orchestration service that allows you to run and scale containerized applications without managing the underlying infrastructure. |
|
|
17
17
|
| [AWS RDS](https://aws.amazon.com/rds/) | Amazon Relational Database Service makes it easy to set up, operate, and scale a relational database in the cloud. Spree works great with multiple databases: [Amazon Aurora both MySQL and PostgreSQL variants](https://aws.amazon.com/rds/aurora/), [RDS PostgreSQL](https://aws.amazon.com/rds/postgresql/), [RDS MySQL](https://aws.amazon.com/rds/mysql/) and [RDS MariaDB](https://aws.amazon.com/rds/mariadb/) |
|
|
18
|
-
| [AWS ElastiCache](https://aws.amazon.com/elasticache/redis/?nc=sn&loc=2&dn=1) | Valkey or Redis instance for background jobs (Sidekiq), [caching](
|
|
19
|
-
| [AWS S3](https://aws.amazon.com/s3/) | Object storage service to store and read your uploaded files such as Product images, etc. [More information](
|
|
18
|
+
| [AWS ElastiCache](https://aws.amazon.com/elasticache/redis/?nc=sn&loc=2&dn=1) | Valkey or Redis instance for background jobs (Sidekiq), [caching](caching.md), and Action Cable. |
|
|
19
|
+
| [AWS S3](https://aws.amazon.com/s3/) | Object storage service to store and read your uploaded files such as Product images, etc. [More information](assets.md#aws-s3). |
|
|
20
20
|
| [AWS CloudFront](https://aws.amazon.com/cloudfront/) | Fast content delivery network CDN to speed up your asset images/stylesheets/javascript delivery. This will greatly enhance your application responsiveness. |
|
|
21
21
|
| [AWS Route 53](https://aws.amazon.com/route53/) | Domain name system (DNS) service to manage your domain names and DNS records. |
|
|
22
22
|
| [AWS Certificate Manager](https://aws.amazon.com/certificate-manager/) | AWS Certificate Manager is a service that provides you with SSL/TLS certificates that you can use to secure your application. Spree in production works only with HTTPS. |
|
|
@@ -24,7 +24,7 @@ To fully run your Spree application on AWS, you will need the following services
|
|
|
24
24
|
|
|
25
25
|
## Docker Image
|
|
26
26
|
|
|
27
|
-
You can use the [official Docker image](
|
|
27
|
+
You can use the [official Docker image](docker.md) (`ghcr.io/spree/spree`) directly, or build your own from your Rails application's Dockerfile.
|
|
28
28
|
|
|
29
29
|
To build and deploy a custom image to AWS ECR via GitHub Actions:
|
|
30
30
|
|
|
@@ -205,7 +205,7 @@ This action requires secrets to be set in your GitHub repository. You can find t
|
|
|
205
205
|
|
|
206
206
|
## Environment variables
|
|
207
207
|
|
|
208
|
-
For a full list of Docker environment variables, please refer to the [Environment variables](
|
|
208
|
+
For a full list of Docker environment variables, please refer to the [Environment variables](environment_variables.md) page.
|
|
209
209
|
|
|
210
210
|
## ECS tasks
|
|
211
211
|
|
|
@@ -95,7 +95,7 @@ docker compose up -d
|
|
|
95
95
|
|
|
96
96
|
The database is automatically created and migrated on first boot. The app is available at [http://localhost:3000](http://localhost:3000).
|
|
97
97
|
|
|
98
|
-
> **TIP:** Use [create-spree-app](
|
|
98
|
+
> **TIP:** Use [create-spree-app](../create-spree-app/quickstart.md) for a fully scaffolded Docker setup with `.env` files, health checks, and optional Next.js storefront — all configured automatically.
|
|
99
99
|
|
|
100
100
|
### Required Environment Variables
|
|
101
101
|
|
|
@@ -105,7 +105,7 @@ The database is automatically created and migrated on first boot. The app is ava
|
|
|
105
105
|
| `REDIS_URL` | Redis URL for jobs, caching, and Action Cable | `redis://redis:6379/0` |
|
|
106
106
|
| `SECRET_KEY_BASE` | Secret key for session encryption | Generate with `bin/rails secret` |
|
|
107
107
|
|
|
108
|
-
See [Environment Variables](
|
|
108
|
+
See [Environment Variables](environment_variables.md) for the full list.
|
|
109
109
|
|
|
110
110
|
## Building Your Own Image
|
|
111
111
|
|
|
@@ -67,7 +67,7 @@ By default, uploaded files (product images, assets) are stored on the local file
|
|
|
67
67
|
|
|
68
68
|
## Search (Meilisearch)
|
|
69
69
|
|
|
70
|
-
Optional. When configured, Spree uses [Meilisearch](
|
|
70
|
+
Optional. When configured, Spree uses [Meilisearch](../../integrations/search/meilisearch.md) for product search, filtering, and faceted navigation instead of SQL.
|
|
71
71
|
|
|
72
72
|
| Variable | Default | Description |
|
|
73
73
|
| --- | --- | --- |
|
|
@@ -55,7 +55,7 @@ Default credentials are created during `db:seed`. Change them immediately after
|
|
|
55
55
|
|
|
56
56
|
### Environment Variables
|
|
57
57
|
|
|
58
|
-
Render sets `DATABASE_URL`, `REDIS_URL`, and `SECRET_KEY_BASE` automatically from the blueprint. For additional configuration (SMTP, file storage, Sentry, etc.), see [Environment Variables](
|
|
58
|
+
Render sets `DATABASE_URL`, `REDIS_URL`, and `SECRET_KEY_BASE` automatically from the blueprint. For additional configuration (SMTP, file storage, Sentry, etc.), see [Environment Variables](environment_variables.md).
|
|
59
59
|
|
|
60
60
|
## Production Sizing
|
|
61
61
|
|
|
@@ -86,10 +86,10 @@ To enable auto-scaling, add this to the web service in your `render.yaml`:
|
|
|
86
86
|
|
|
87
87
|
Render provides ephemeral storage — uploaded files (product images, etc.) won't persist across deploys. Set up cloud storage:
|
|
88
88
|
|
|
89
|
-
- [Asset Storage](
|
|
89
|
+
- [Asset Storage](assets.md) (Amazon S3 / Cloudflare R2)
|
|
90
90
|
|
|
91
91
|
Before going to production:
|
|
92
92
|
|
|
93
|
-
- [Set environment variables](
|
|
94
|
-
- [Configure CDN](
|
|
95
|
-
- [Configure caching](
|
|
93
|
+
- [Set environment variables](environment_variables.md) (SMTP, SSL, etc.)
|
|
94
|
+
- [Configure CDN](cdn.md)
|
|
95
|
+
- [Configure caching](caching.md)
|
|
@@ -23,7 +23,7 @@ The quickest way to get started. Scaffolds a full Spree project with Next.js Sto
|
|
|
23
23
|
|
|
24
24
|
Once complete, your store should be running at [http://localhost:3000/admin](http://localhost:3000/admin). The port can be different if `3000` is already used on your system.
|
|
25
25
|
|
|
26
|
-
See the full [create-spree-app documentation](
|
|
26
|
+
See the full [create-spree-app documentation](../create-spree-app/quickstart.md) for all CLI flags and options.
|
|
27
27
|
|
|
28
28
|
**Manual Installation:**
|
|
29
29
|
|
|
@@ -57,7 +57,7 @@ For developers who prefer full control over the setup, or want to add Spree to a
|
|
|
57
57
|
bin/rails spree_sample:load
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
> **INFO:** Spree works with **PostgreSQL**, **MySQL**, and **SQLite** databases. The Rails template defaults to SQLite for quick setup. You can switch to PostgreSQL or MySQL at any time. [Learn more about database configuration](
|
|
60
|
+
> **INFO:** Spree works with **PostgreSQL**, **MySQL**, and **SQLite** databases. The Rails template defaults to SQLite for quick setup. You can switch to PostgreSQL or MySQL at any time. [Learn more about database configuration](../deployment/database.md).
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
## Accessing Admin Panel
|
|
@@ -13,7 +13,7 @@ This guide walks you through building a custom payment method integration for Sp
|
|
|
13
13
|
- Handles webhooks for reliable payment confirmation
|
|
14
14
|
- Optionally supports saving payment methods for future use (Payment Setup Sessions)
|
|
15
15
|
|
|
16
|
-
Before starting, make sure you understand [how payments work in Spree](
|
|
16
|
+
Before starting, make sure you understand [how payments work in Spree](../core-concepts/payments.md).
|
|
17
17
|
|
|
18
18
|
## Step 1: Create the Payment Method Model
|
|
19
19
|
|
|
@@ -367,8 +367,8 @@ For every gateway action (authorize, purchase, capture, void, credit), Spree pas
|
|
|
367
367
|
|
|
368
368
|
## Related Documentation
|
|
369
369
|
|
|
370
|
-
- [Payments](
|
|
371
|
-
- [Checkout Customization](
|
|
372
|
-
- [Events](
|
|
373
|
-
- [Stripe Integration](
|
|
374
|
-
- [Adyen Integration](
|
|
370
|
+
- [Payments](../core-concepts/payments.md) - Payment architecture and core concepts
|
|
371
|
+
- [Checkout Customization](../customization/checkout.md) - Customizing the checkout flow
|
|
372
|
+
- [Events](../core-concepts/events.md) - Subscribe to payment events
|
|
373
|
+
- [Stripe Integration](../../integrations/payments/stripe.md) - Reference implementation using Stripe
|
|
374
|
+
- [Adyen Integration](../../integrations/payments/adyen.md) - Reference implementation using Adyen
|
|
@@ -5,14 +5,14 @@ description: Step-by-step guide to creating custom promotion rules and actions f
|
|
|
5
5
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
8
|
-
Spree's promotion system is built around two extension points: **Rules** (eligibility conditions) and **Actions** (what happens when a promotion applies). While Spree ships with a comprehensive set of [built-in rules and actions](
|
|
8
|
+
Spree's promotion system is built around two extension points: **Rules** (eligibility conditions) and **Actions** (what happens when a promotion applies). While Spree ships with a comprehensive set of [built-in rules and actions](../core-concepts/promotions.md#rules), you can create custom ones for business-specific logic.
|
|
9
9
|
|
|
10
10
|
This guide covers:
|
|
11
11
|
- Creating a custom promotion rule with admin UI
|
|
12
12
|
- Creating a custom promotion action with a calculator
|
|
13
13
|
- Understanding the `eligible?`, `actionable?`, and `perform` contracts
|
|
14
14
|
|
|
15
|
-
Before starting, make sure you understand [how promotions work in Spree](
|
|
15
|
+
Before starting, make sure you understand [how promotions work in Spree](../core-concepts/promotions.md).
|
|
16
16
|
|
|
17
17
|
## Custom Promotion Rules
|
|
18
18
|
|
|
@@ -153,7 +153,7 @@ end
|
|
|
153
153
|
|
|
154
154
|
## Custom Promotion Actions
|
|
155
155
|
|
|
156
|
-
Actions define what happens when a promotion is applied. Most actions create [adjustments](
|
|
156
|
+
Actions define what happens when a promotion is applied. Most actions create [adjustments](../core-concepts/adjustments.md) on orders or line items.
|
|
157
157
|
|
|
158
158
|
### Step 1: Create the Action Class
|
|
159
159
|
|
|
@@ -367,7 +367,7 @@ end
|
|
|
367
367
|
|
|
368
368
|
## Related Documentation
|
|
369
369
|
|
|
370
|
-
- [Promotions](
|
|
371
|
-
- [Calculators](
|
|
372
|
-
- [Adjustments](
|
|
373
|
-
- [Events](
|
|
370
|
+
- [Promotions](../core-concepts/promotions.md) - Promotion architecture and built-in rules/actions
|
|
371
|
+
- [Calculators](../core-concepts/calculators.md) - Available calculator types for promotion actions
|
|
372
|
+
- [Adjustments](../core-concepts/adjustments.md) - How adjustments work on orders and line items
|
|
373
|
+
- [Events](../core-concepts/events.md) - Subscribe to promotion events
|
|
@@ -9,7 +9,7 @@ Spree's reporting system is designed for extension. Each report is a pair of cla
|
|
|
9
9
|
|
|
10
10
|
This guide walks you through building a custom report from scratch, including advanced patterns for SQL aggregations and multi-vendor support.
|
|
11
11
|
|
|
12
|
-
Before starting, make sure you understand [how the reporting system works](
|
|
12
|
+
Before starting, make sure you understand [how the reporting system works](../core-concepts/reports.md).
|
|
13
13
|
|
|
14
14
|
## Creating a Custom Report
|
|
15
15
|
|
|
@@ -383,5 +383,5 @@ end
|
|
|
383
383
|
|
|
384
384
|
## Related Documentation
|
|
385
385
|
|
|
386
|
-
- [Reports](
|
|
387
|
-
- [Events](
|
|
386
|
+
- [Reports](../core-concepts/reports.md) - Report architecture and built-in reports
|
|
387
|
+
- [Events](../core-concepts/events.md) - How report generation uses the events system
|
|
@@ -12,9 +12,9 @@ This guide walks you through building a custom search provider for Spree. By the
|
|
|
12
12
|
- Integrates with the Store API without any frontend changes
|
|
13
13
|
- Supports background indexing and bulk reindex
|
|
14
14
|
|
|
15
|
-
Before starting, make sure you understand [how search and filtering works in Spree](
|
|
15
|
+
Before starting, make sure you understand [how search and filtering works in Spree](../core-concepts/search-filtering.md).
|
|
16
16
|
|
|
17
|
-
> **INFO:** Spree ships with a built-in [Meilisearch provider](
|
|
17
|
+
> **INFO:** Spree ships with a built-in [Meilisearch provider](../../integrations/search/meilisearch.md). If Meilisearch fits your needs, you don't need to build a custom provider — just configure it.
|
|
18
18
|
|
|
19
19
|
## Architecture
|
|
20
20
|
|
|
@@ -131,7 +131,7 @@ The `ProductPresenter` returns an array of documents. For a store with US (USD/E
|
|
|
131
131
|
|
|
132
132
|
## Step 4: Implement Bulk Reindex
|
|
133
133
|
|
|
134
|
-
Use `
|
|
134
|
+
Use `preload_associations_lazily` to avoid N+1 queries:
|
|
135
135
|
|
|
136
136
|
```ruby app/models/my_app/search_provider/typesense.rb
|
|
137
137
|
def reindex(scope = nil)
|
|
@@ -139,9 +139,9 @@ def reindex(scope = nil)
|
|
|
139
139
|
ensure_index_settings!
|
|
140
140
|
|
|
141
141
|
scope.reorder(id: :asc)
|
|
142
|
-
.
|
|
142
|
+
.preload_associations_lazily
|
|
143
143
|
.find_in_batches(batch_size: 500) do |batch|
|
|
144
|
-
documents = batch.flat_map { |p|
|
|
144
|
+
documents = batch.flat_map { |p| presenter_class.new(p, store).call }
|
|
145
145
|
index_batch(documents)
|
|
146
146
|
end
|
|
147
147
|
end
|
|
@@ -226,5 +226,5 @@ Always use prefixed IDs (`ctg_abc`, `prod_xyz`, `optval_abc`) when indexing. Nev
|
|
|
226
226
|
|
|
227
227
|
## Related Documentation
|
|
228
228
|
|
|
229
|
-
- [Search & Filtering](
|
|
230
|
-
- [Meilisearch Integration](
|
|
229
|
+
- [Search & Filtering](../core-concepts/search-filtering.md) — Store API search reference
|
|
230
|
+
- [Meilisearch Integration](../../integrations/search/meilisearch.md) — Built-in Meilisearch provider setup
|
|
@@ -17,4 +17,4 @@ To sum it up:
|
|
|
17
17
|
|
|
18
18
|
## Setup SaaS application
|
|
19
19
|
|
|
20
|
-
[Follow the installation instructions](
|
|
20
|
+
[Follow the installation instructions](installation.md) to setup a multi-tenant Spree application.
|
|
@@ -3,7 +3,7 @@ title: Authentication
|
|
|
3
3
|
description: Authentication modes and guest checkout with the Spree SDK
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
The SDK supports multiple authentication modes depending on your use case. For a full overview of the API authentication methods, see the [Store API Authentication](
|
|
6
|
+
The SDK supports multiple authentication modes depending on your use case. For a full overview of the API authentication methods, see the [Store API Authentication](../../api-reference/store-api/authentication.md) reference.
|
|
7
7
|
|
|
8
8
|
## Publishable Key Only (Guest/Public Access)
|
|
9
9
|
|
|
@@ -5,7 +5,7 @@ description: Localization, error handling, TypeScript types, and custom fetch
|
|
|
5
5
|
|
|
6
6
|
## Localization & Currency
|
|
7
7
|
|
|
8
|
-
Pass locale and currency headers with any request. For full details, see the [Localization](
|
|
8
|
+
Pass locale and currency headers with any request. For full details, see the [Localization](../../api-reference/store-api/localization.md) reference.
|
|
9
9
|
|
|
10
10
|
```typescript
|
|
11
11
|
// Set locale and currency per request
|
|
@@ -146,6 +146,6 @@ curl 'https://api.mystore.com/api/v3/store/markets/mkt_gbHJdmfrXB/countries/US?e
|
|
|
146
146
|
|
|
147
147
|
## Related Documentation
|
|
148
148
|
|
|
149
|
-
- [Markets](
|
|
150
|
-
- [Localization](
|
|
151
|
-
- [Geography](
|
|
149
|
+
- [Markets](../../core-concepts/markets.md) — Market concepts, zones, and configuration
|
|
150
|
+
- [Localization](../../../api-reference/store-api/localization.md) — Locale and currency headers
|
|
151
|
+
- [Geography](products.md#geography) — Global country endpoints
|
|
@@ -138,4 +138,4 @@ export default async function YourNewPage() {
|
|
|
138
138
|
|
|
139
139
|
## Building a Custom Storefront
|
|
140
140
|
|
|
141
|
-
If you prefer to build from scratch instead of forking the starter, you can use the `@spree/next` and `@spree/sdk` packages directly in any Next.js application. See the [@spree/next Package](
|
|
141
|
+
If you prefer to build from scratch instead of forking the starter, you can use the `@spree/next` and `@spree/sdk` packages directly in any Next.js application. See the [@spree/next Package](spree-next-package.md) documentation for the complete API reference.
|
|
@@ -72,7 +72,7 @@ SPREE_PUBLISHABLE_KEY=your_publishable_api_key_here
|
|
|
72
72
|
|
|
73
73
|
> **NOTE:** These are server-side only variables — no `NEXT_PUBLIC_` prefix needed since all API calls happen in Server Actions.
|
|
74
74
|
|
|
75
|
-
See [Deployment](
|
|
75
|
+
See [Deployment](deployment.md) for all optional environment variables (Sentry, GTM, etc.).
|
|
76
76
|
|
|
77
77
|
## Development
|
|
78
78
|
|
|
@@ -89,4 +89,4 @@ npm run build
|
|
|
89
89
|
npm start
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
See the [Deployment](
|
|
92
|
+
See the [Deployment](deployment.md) guide for Vercel, Docker, and other hosting options.
|