@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
|
@@ -83,7 +83,7 @@ Spree.admin.tables.brands.add :description,
|
|
|
83
83
|
position: 15
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
> **INFO:** For complete table customization options including column types, filtering, sorting, and bulk actions, see the [Admin Tables](
|
|
86
|
+
> **INFO:** For complete table customization options including column types, filtering, sorting, and bulk actions, see the [Admin Tables](../admin/tables.md) guide.
|
|
87
87
|
|
|
88
88
|
## Step 3: Customize Navigation
|
|
89
89
|
|
|
@@ -131,4 +131,4 @@ end
|
|
|
131
131
|
|
|
132
132
|
After restarting your server, you'll see the new "Brands" navigation link in the admin sidebar!
|
|
133
133
|
|
|
134
|
-
> **INFO:** For complete navigation API documentation including all available options, submenu creation, badges, and more, see the [Admin Navigation](
|
|
134
|
+
> **INFO:** For complete navigation API documentation including all available options, submenu creation, badges, and more, see the [Admin Navigation](../admin/navigation.md) guide.
|
|
@@ -5,7 +5,7 @@ description: Learn how to extend Spree's core models to connect Brands with Prod
|
|
|
5
5
|
|
|
6
6
|
In this tutorial, we'll connect our custom Brand model with Spree's core Product model. This is a common pattern when building features that need to integrate with existing Spree functionality.
|
|
7
7
|
|
|
8
|
-
> **INFO:** This guide assumes you've completed the [Model](
|
|
8
|
+
> **INFO:** This guide assumes you've completed the [Model](model.md), [Admin](admin.md), and [File Uploads](file-uploads.md) tutorials.
|
|
9
9
|
|
|
10
10
|
## What We're Building
|
|
11
11
|
|
|
@@ -24,12 +24,12 @@ Before extending Spree models, consider which approach fits your needs best:
|
|
|
24
24
|
| Add association (belongs_to, has_many) | **Decorator** (this tutorial) |
|
|
25
25
|
| Add validation or scope | **Decorator** |
|
|
26
26
|
| Add new instance/class method | **Decorator** |
|
|
27
|
-
| React to model changes (after save, etc.) | [Events subscriber](
|
|
28
|
-
| Sync with external service on changes | [Events](
|
|
29
|
-
| Add searchable/filterable field | [Ransack configuration](
|
|
30
|
-
| Add admin UI elements | [Admin Partials](
|
|
27
|
+
| React to model changes (after save, etc.) | [Events subscriber](../core-concepts/events.md) |
|
|
28
|
+
| Sync with external service on changes | [Events](../core-concepts/events.md) or [Webhooks](../core-concepts/webhooks.md) |
|
|
29
|
+
| Add searchable/filterable field | [Ransack configuration](../core-concepts/search-filtering.md#extending-ransackable-configuration) |
|
|
30
|
+
| Add admin UI elements | [Admin Partials](../admin/extending-ui.md) |
|
|
31
31
|
|
|
32
|
-
> **INFO:** This tutorial uses **decorators** because we're adding a structural association between models. For behavioral changes like callbacks, prefer [Events](
|
|
32
|
+
> **INFO:** This tutorial uses **decorators** because we're adding a structural association between models. For behavioral changes like callbacks, prefer [Events](../core-concepts/events.md) instead - they're easier to test and maintain.
|
|
33
33
|
|
|
34
34
|
## Understanding Decorators
|
|
35
35
|
|
|
@@ -267,7 +267,7 @@ end
|
|
|
267
267
|
|
|
268
268
|
#### Adding Callbacks
|
|
269
269
|
|
|
270
|
-
> **WARNING:** For callbacks that trigger side effects (syncing to external services, sending notifications, etc.), use [Events subscribers](
|
|
270
|
+
> **WARNING:** For callbacks that trigger side effects (syncing to external services, sending notifications, etc.), use [Events subscribers](../core-concepts/events.md) instead of decorator callbacks. Events are easier to test and won't break during Spree upgrades.
|
|
271
271
|
|
|
272
272
|
**Decorator approach** (use only for simple, internal logic):
|
|
273
273
|
|
|
@@ -343,7 +343,7 @@ module Spree
|
|
|
343
343
|
end
|
|
344
344
|
```
|
|
345
345
|
|
|
346
|
-
> **INFO:** SEO features like slugs, meta titles, and FriendlyId are covered in the [
|
|
346
|
+
> **INFO:** SEO features like slugs, meta titles, and FriendlyId are covered in the [Slugs](../core-concepts/slugs.md) documentation.
|
|
347
347
|
|
|
348
348
|
### Spree Initializer Additions
|
|
349
349
|
|
|
@@ -371,10 +371,10 @@ Spree::PermittedAttributes.product_attributes << :brand_id
|
|
|
371
371
|
|
|
372
372
|
## Related Documentation
|
|
373
373
|
|
|
374
|
-
- [Model Tutorial](
|
|
375
|
-
- [Admin Tutorial](
|
|
376
|
-
- [Events](
|
|
377
|
-
- [Webhooks](
|
|
378
|
-
- [Decorators](
|
|
379
|
-
- [Customization Overview](
|
|
380
|
-
- [Products](
|
|
374
|
+
- [Model Tutorial](model.md) - Creating the Brand model
|
|
375
|
+
- [Admin Tutorial](admin.md) - Building the admin interface
|
|
376
|
+
- [Events](../core-concepts/events.md) - Subscribe to model changes without decorators
|
|
377
|
+
- [Webhooks](../core-concepts/webhooks.md) - HTTP callbacks for external integrations
|
|
378
|
+
- [Decorators](../customization/decorators.md) - Full decorator reference
|
|
379
|
+
- [Customization Overview](../customization/quickstart.md) - More customization patterns
|
|
380
|
+
- [Products](../core-concepts/products.md) - Product model documentation
|
|
@@ -3,7 +3,7 @@ title: File Uploads
|
|
|
3
3
|
description: Learn how to add file uploads to the Brands feature
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **INFO:** This guide assumes you've completed the [Model](
|
|
6
|
+
> **INFO:** This guide assumes you've completed the [Model](model.md), [Admin](admin.md), and [Rich Text](rich-text.md) tutorials.
|
|
7
7
|
|
|
8
8
|
In this tutorial, we'll add a logo image upload to our Brand model. Spree uses [Rails Active Storage](https://guides.rubyonrails.org/active_storage_overview.html) for handling file attachments, image processing, and storage.
|
|
9
9
|
|
|
@@ -20,14 +20,14 @@ To fully implement a new feature, you will typically create the following compon
|
|
|
20
20
|
## Tutorial Sections
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
- [1. Model](
|
|
24
|
-
- [2. Admin Dashboard](
|
|
25
|
-
- [3. Rich Text](
|
|
26
|
-
- [4. File Uploads](
|
|
27
|
-
- [5. Extending Core Models](
|
|
28
|
-
- [7. Testing](
|
|
23
|
+
- [1. Model](model.md) — Create the Brand model with migrations, validations, and associations
|
|
24
|
+
- [2. Admin Dashboard](admin.md) — Build admin interface for managing brands
|
|
25
|
+
- [3. Rich Text](rich-text.md) — Add rich text descriptions using Action Text
|
|
26
|
+
- [4. File Uploads](file-uploads.md) — Add logo images with Active Storage
|
|
27
|
+
- [5. Extending Core Models](extending-models.md) — Connect Brands to Products using associations
|
|
28
|
+
- [7. Testing](testing.md) — Write automated tests for your feature
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
## Example: Building a Brands Feature
|
|
32
32
|
|
|
33
|
-
In this guide we will create a complete "Brands" feature that allows admins to manage [Product](
|
|
33
|
+
In this guide we will create a complete "Brands" feature that allows admins to manage [Product](../core-concepts/products.md) brands.
|
|
@@ -3,7 +3,7 @@ title: Rich Text
|
|
|
3
3
|
description: Learn how to add rich text content to the Brands feature using Action Text
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **INFO:** This guide assumes you've completed the [Model](
|
|
6
|
+
> **INFO:** This guide assumes you've completed the [Model](model.md) and [Admin](admin.md) tutorials.
|
|
7
7
|
|
|
8
8
|
Our Brand model has a `name` attribute to store the brand name. However it's missing a description. That's because we're going to use [Action Text](https://guides.rubyonrails.org/action_text_overview.html) to handle the rich text content.
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ Automated testing is a crucial part of the development process. It helps you ens
|
|
|
4
4
|
Spree uses [RSpec](https://rspec.info), [Factory Bot](https://github.com/thoughtbot/factory_bot_rails), and [Capybara](https://github.com/teamcapybara/capybara) for testing.
|
|
5
5
|
We also provide the `spree_dev_tools` gem that helps you write Spree-specific tests.
|
|
6
6
|
|
|
7
|
-
> **INFO:** This guide assumes you've completed all previous tutorials through [
|
|
7
|
+
> **INFO:** This guide assumes you've completed all previous tutorials through [Extending Models](extending-models.md). You should have a complete `Spree::Brand` model with admin features.
|
|
8
8
|
|
|
9
9
|
## Setup
|
|
10
10
|
|
|
@@ -163,7 +163,7 @@ end
|
|
|
163
163
|
|
|
164
164
|
### Testing Decorators
|
|
165
165
|
|
|
166
|
-
When you extend core Spree models with decorators (see [Extending Core Models](
|
|
166
|
+
When you extend core Spree models with decorators (see [Extending Core Models](extending-models.md)), test the added functionality:
|
|
167
167
|
|
|
168
168
|
```ruby spec/models/spree/product_decorator_spec.rb
|
|
169
169
|
require 'rails_helper'
|
|
@@ -318,61 +318,6 @@ RSpec.describe Spree::Admin::BrandsController, type: :controller do
|
|
|
318
318
|
end
|
|
319
319
|
```
|
|
320
320
|
|
|
321
|
-
### Storefront Controller Tests
|
|
322
|
-
|
|
323
|
-
```ruby spec/controllers/spree/brands_controller_spec.rb
|
|
324
|
-
require 'rails_helper'
|
|
325
|
-
|
|
326
|
-
RSpec.describe Spree::Brand, type: :model do
|
|
327
|
-
describe 'associations' do
|
|
328
|
-
it 'has many products' do
|
|
329
|
-
association = described_class.reflect_on_association(:products)
|
|
330
|
-
expect(association.macro).to eq(:has_many)
|
|
331
|
-
expect(association.class_name).to eq('Spree::Product')
|
|
332
|
-
end
|
|
333
|
-
end
|
|
334
|
-
|
|
335
|
-
describe 'validations' do
|
|
336
|
-
it 'validates presence of name' do
|
|
337
|
-
brand = build(:brand, name: nil)
|
|
338
|
-
expect(brand).not_to be_valid
|
|
339
|
-
expect(brand.errors[:name]).to include("can't be blank")
|
|
340
|
-
end
|
|
341
|
-
|
|
342
|
-
describe 'slug uniqueness' do
|
|
343
|
-
let!(:existing_brand) { create(:brand, slug: 'nike') }
|
|
344
|
-
|
|
345
|
-
it 'validates uniqueness of slug' do
|
|
346
|
-
brand = build(:brand, slug: 'nike')
|
|
347
|
-
expect(brand).not_to be_valid
|
|
348
|
-
expect(brand.errors[:slug]).to include('has already been taken')
|
|
349
|
-
end
|
|
350
|
-
end
|
|
351
|
-
end
|
|
352
|
-
|
|
353
|
-
describe 'FriendlyId' do
|
|
354
|
-
it 'generates slug from name' do
|
|
355
|
-
brand = create(:brand, name: 'Nike Sportswear', slug: nil)
|
|
356
|
-
expect(brand.slug).to eq('nike-sportswear')
|
|
357
|
-
end
|
|
358
|
-
|
|
359
|
-
it 'handles duplicate names by appending UUID' do
|
|
360
|
-
create(:brand, name: 'Nike', slug: 'nike')
|
|
361
|
-
brand = create(:brand, name: 'Nike', slug: nil)
|
|
362
|
-
expect(brand.slug).to match(/nike-[a-f0-9-]+/)
|
|
363
|
-
end
|
|
364
|
-
end
|
|
365
|
-
|
|
366
|
-
describe '#image' do
|
|
367
|
-
let(:brand) { create(:brand, :with_logo) }
|
|
368
|
-
|
|
369
|
-
it 'returns logo as image for Open Graph' do
|
|
370
|
-
expect(brand.image).to eq(brand.logo)
|
|
371
|
-
end
|
|
372
|
-
end
|
|
373
|
-
end
|
|
374
|
-
```
|
|
375
|
-
|
|
376
321
|
## Writing Feature Tests
|
|
377
322
|
|
|
378
323
|
Feature tests (also called system tests) simulate real user interactions using Capybara.
|
|
@@ -547,10 +492,9 @@ spec/
|
|
|
547
492
|
|
|
548
493
|
## Related Documentation
|
|
549
494
|
|
|
550
|
-
* [Model Tutorial](
|
|
551
|
-
* [Admin Tutorial](
|
|
552
|
-
* [Extending Core Models](
|
|
553
|
-
* [Storefront Tutorial](/developer/tutorial/storefront) - Creating storefront pages
|
|
495
|
+
* [Model Tutorial](model.md) - Creating the Brand model
|
|
496
|
+
* [Admin Tutorial](admin.md) - Building the admin interface
|
|
497
|
+
* [Extending Core Models](extending-models.md) - Connecting Brands to Products
|
|
554
498
|
* [RSpec Documentation](https://rspec.info/documentation/) - Official RSpec docs
|
|
555
499
|
* [Factory Bot Documentation](https://github.com/thoughtbot/factory_bot/blob/main/GETTING_STARTED.md) - Factory Bot guide
|
|
556
500
|
|
|
@@ -112,7 +112,7 @@ end
|
|
|
112
112
|
Spree::Base.singleton_class.send :prepend, Spree::BaseDecorator
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
Please also consider other options for [Logic Customization](
|
|
115
|
+
Please also consider other options for [Logic Customization](../customization.md).
|
|
116
116
|
|
|
117
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
118
|
|
|
@@ -55,7 +55,7 @@ To replace your current frontend with the new Spree UI follow these steps:
|
|
|
55
55
|
3. Next, you will need to copy over two files:
|
|
56
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
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](
|
|
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](../customization.md#extending-controllers)
|
|
59
59
|
5. The same goes for [helpers](https://github.com/spree/spree/tree/master/frontend/app/helpers/spree)
|
|
60
60
|
6. You will also need to remove this line:
|
|
61
61
|
|
|
@@ -3,7 +3,7 @@ title: Upgrading to Spree 5.0
|
|
|
3
3
|
description: This guide covers upgrading a Spree 4.10 application to Spree 5.0.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 4.10](
|
|
6
|
+
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 4.10](4.9-to-4.10.md)
|
|
7
7
|
|
|
8
8
|
Spree 5.0 is a major upgrade that introduces many breaking changes. The major changes are:
|
|
9
9
|
|
|
@@ -26,7 +26,7 @@ If your application used the spree_globalize extension, you can remove it from y
|
|
|
26
26
|
|
|
27
27
|
We've configured Mobility to use [a strategy that uses a separate table to store translations](https://dejimata.com/2017/3/3/translating-with-mobility#strategy-2), just like how spree_globalize did. This means, you won't need to make any changes to the database structure or migrate data.
|
|
28
28
|
|
|
29
|
-
During the upgrade process, you may need to review your custom queries that rely on translations, as there are minor differences in how Mobility handles them. Spree 4.6 includes a few [built-in concerns](
|
|
29
|
+
During the upgrade process, you may need to review your custom queries that rely on translations, as there are minor differences in how Mobility handles them. Spree 4.6 includes a few [built-in concerns](../core-concepts/translations.md#resource-translations-implementation) to make it easier to work with translatable models.
|
|
30
30
|
|
|
31
31
|
Run the following command to remove spree_globalize from your Gemfile:
|
|
32
32
|
|
|
@@ -68,7 +68,7 @@ bin/rails g spree:frontend:install
|
|
|
68
68
|
|
|
69
69
|
### Update migrations for translation tables with additional columns
|
|
70
70
|
|
|
71
|
-
If you want to translate more fields in [translated resources](
|
|
71
|
+
If you want to translate more fields in [translated resources](../core-concepts/translations.md#resource-translations), you have to alter copied migrations or add new ones.
|
|
72
72
|
We're using the [Spree::TranslationMigrations](https://github.com/spree/spree/blob/main/core/lib/spree/translation_migrations.rb) to help with migrating data.
|
|
73
73
|
|
|
74
74
|
### Add or update the behavior of the translated model
|
|
@@ -80,7 +80,7 @@ If you overwrote Spree models in your application, you have to define this block
|
|
|
80
80
|
- `Spree::TranslatableResource` - required for all translated models
|
|
81
81
|
- `Spree::TranslatableResourceSlug` - required for translated models with slugs/permalinks
|
|
82
82
|
|
|
83
|
-
[Read more](
|
|
83
|
+
[Read more](../core-concepts/translations.md#resource-translations-implementation) how Spree handles resource translations.
|
|
84
84
|
|
|
85
85
|
### Generating slugs with `friendly_id`
|
|
86
86
|
|
|
@@ -92,7 +92,7 @@ Currently, it's not possible to translate encrypted data. If you're already encr
|
|
|
92
92
|
|
|
93
93
|
### Full text search with pg_search scopes
|
|
94
94
|
|
|
95
|
-
If you use the [pg_search](https://github.com/Casecommons/pg_search) for the full text search in [translated resources](
|
|
95
|
+
If you use the [pg_search](https://github.com/Casecommons/pg_search) for the full text search in [translated resources](../core-concepts/translations.md#resource-translations), you need to move your scopes to the translated model, eg. from the `Spree::Product` to the `Spree::Product::Translation`.
|
|
96
96
|
|
|
97
97
|
If you still want to have the original scope, you need to rewrite it, from:
|
|
98
98
|
|
|
@@ -3,7 +3,7 @@ title: Upgrading to Spree 4.9
|
|
|
3
3
|
description: This guide covers upgrading a Spree 4.8 application to Spree 4.9.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 4.8](
|
|
6
|
+
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 4.8](4.x-to-4.8.md)
|
|
7
7
|
|
|
8
8
|
## Upgrade steps
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ title: Upgrading to Spree 4.10
|
|
|
3
3
|
description: This guide covers upgrading a Spree 4.9 application to Spree 4.10.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 4.9](
|
|
6
|
+
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 4.9](4.8-to-4.9.md)
|
|
7
7
|
|
|
8
8
|
## Upgrade steps
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ title: Upgrading to Spree 5.1
|
|
|
3
3
|
description: This guide covers upgrading a Spree 5.0 application to Spree 5.1.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.0](
|
|
6
|
+
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.0](4.10-to-5.0.md)
|
|
7
7
|
|
|
8
8
|
## Upgrade steps
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ title: Upgrading to Spree 5.2
|
|
|
3
3
|
description: This guide covers upgrading a Spree 5.1 application to Spree 5.2.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.1](
|
|
6
|
+
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.1](5.0-to-5.1.md)
|
|
7
7
|
|
|
8
8
|
## Upgrade steps
|
|
9
9
|
|
|
@@ -33,7 +33,7 @@ bin/rake spree:install:migrations && bin/rails db:migrate
|
|
|
33
33
|
|
|
34
34
|
### Migrate to Metafields or keep using Product Properties
|
|
35
35
|
|
|
36
|
-
Spree 5.2 introduces [Metafields](
|
|
36
|
+
Spree 5.2 introduces [Metafields](../core-concepts/metafields.md), which are a new way to store additional information about an object. Previously, we used Product Properties to enrich products. Metafields are more powerful, more flexible and can be attached to any object not just products.
|
|
37
37
|
|
|
38
38
|
However we now that properties were available in Spree since it's beginning. So we decided to keep them for backward compatibility until Spree 6.0 to give you time to migrate to metafields.
|
|
39
39
|
|
|
@@ -3,7 +3,7 @@ title: Upgrading to Spree 5.3
|
|
|
3
3
|
description: This guide covers upgrading a Spree 5.2 application to Spree 5.3.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.2](
|
|
6
|
+
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.2](5.1-to-5.2.md)
|
|
7
7
|
|
|
8
8
|
## Upgrade steps
|
|
9
9
|
|
|
@@ -263,7 +263,7 @@ Spree.admin.tables.orders.add :vendor,
|
|
|
263
263
|
partial: 'spree/admin/orders/table/vendor_column'
|
|
264
264
|
```
|
|
265
265
|
|
|
266
|
-
See the [Admin Tables documentation](
|
|
266
|
+
See the [Admin Tables documentation](../admin/tables.md) for more details.
|
|
267
267
|
|
|
268
268
|
### Tailwind CSS v4 Migration
|
|
269
269
|
|
|
@@ -3,7 +3,7 @@ title: Upgrading to Spree 5.4
|
|
|
3
3
|
description: This guide covers upgrading a Spree 5.3 application to Spree 5.4.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.3](
|
|
6
|
+
> **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.3](5.2-to-5.3.md)
|
|
7
7
|
|
|
8
8
|
## Upgrade steps
|
|
9
9
|
|
|
@@ -93,7 +93,7 @@ Prefix length isn't limited by default, but we recommend to keep it short.
|
|
|
93
93
|
|
|
94
94
|
### Migrate Checkout Zones to Markets
|
|
95
95
|
|
|
96
|
-
Spree 5.4 introduces [Markets](
|
|
96
|
+
Spree 5.4 introduces [Markets](../core-concepts/markets.md) as the primary way to manage which countries are available for checkout, along with their currencies and locales. The legacy `checkout_zone` field on the Store model is now deprecated and will be removed in Spree 5.5.
|
|
97
97
|
|
|
98
98
|
New stores automatically get a default market created from their `default_country` — no manual setup needed. For existing stores that used `checkout_zone`, run the migration rake task:
|
|
99
99
|
|
|
@@ -114,8 +114,8 @@ The following Store methods now emit deprecation warnings and will be removed in
|
|
|
114
114
|
|
|
115
115
|
| Deprecated method | Replacement |
|
|
116
116
|
|---|---|
|
|
117
|
-
| `store.checkout_zone` | Use [Markets](
|
|
118
|
-
| `store.checkout_zone=` | Use [Markets](
|
|
117
|
+
| `store.checkout_zone` | Use [Markets](../core-concepts/markets.md) to manage countries |
|
|
118
|
+
| `store.checkout_zone=` | Use [Markets](../core-concepts/markets.md) to manage countries |
|
|
119
119
|
|
|
120
120
|
The `store.default_country` reader now returns the first country (by name) from the store's default market. The `store.default_country_iso=` setter still works and is used to set the country when creating a store — a default market is automatically created from it.
|
|
121
121
|
|
|
@@ -235,7 +235,7 @@ If you rely on these features please run:
|
|
|
235
235
|
|
|
236
236
|
### (Optional) Install Legacy Product Properties
|
|
237
237
|
|
|
238
|
-
Product Properties have been extracted from Spree core to a separate gem `spree_legacy_product_properties`. Product Properties were already deprecated in favor of [Metafields](
|
|
238
|
+
Product Properties have been extracted from Spree core to a separate gem `spree_legacy_product_properties`. Product Properties were already deprecated in favor of [Metafields](../core-concepts/metafields.md) and disabled by default since Spree 5.1.
|
|
239
239
|
|
|
240
240
|
If you have `product_properties_enabled: true` in your Spree configuration or rely on Product Properties in any way, install the extension:
|
|
241
241
|
|
|
@@ -31,6 +31,6 @@ New features, will likely contain API changes. The difference between Spree mino
|
|
|
31
31
|
|
|
32
32
|
## Security
|
|
33
33
|
|
|
34
|
-
Our Security policy is [described here](
|
|
34
|
+
Our Security policy is [described here](../security.md).
|
|
35
35
|
|
|
36
36
|
When a release series is no longer supported, it's your own responsibility to deal with bugs and security issues. We may provide backports of some critical security fixes.
|
|
@@ -7,33 +7,33 @@ description: "Learn how to connect your Spree application to third-party service
|
|
|
7
7
|
## Payments
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
- [Stripe](
|
|
11
|
-
- [Adyen](
|
|
12
|
-
- [PayPal](
|
|
13
|
-
- [RazorPay](
|
|
10
|
+
- [Stripe](payments/stripe.md) — Stripe is a popular payment gateway that allows you to accept payments from your customers. Credit cards, wallets, buy-now-pay-later, installment payments and more.
|
|
11
|
+
- [Adyen](payments/adyen.md) — Adyen is a global payment platform that enables businesses to accept payments across multiple channels and markets. Credit cards, digital wallets, BNPL, local payment methods, and more across 150+ currencies.
|
|
12
|
+
- [PayPal](payments/paypal.md) — PayPal is an online payment system that allows you to send and receive money around the world. You can link your credit card, debit card, or bank account. You can also set up a PayPal Balance account.
|
|
13
|
+
- [RazorPay](payments/razorpay.md) — Razorpay is a secure payment gateway that enables businesses to accept online payments via cards, UPI, net banking, and wallets. It also supports international transactions across multiple currencies.
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
## Search
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
- [Meilisearch](
|
|
19
|
+
- [Meilisearch](search/meilisearch.md) — One platform to build, scale, and unify search and AI retrieval. Search-as-you-type returns answers in less than 50 milliseconds. That's faster than the blink of an eye!
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
## Analytics
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
- [Google Analytics 4](
|
|
26
|
-
- [Google Tag Manager](
|
|
25
|
+
- [Google Analytics 4](analytics/google-analytics.md) — Google Analytics 4 is a powerful analytics tool that allows you to track user behavior, sales performance, and marketing effectiveness across your store.
|
|
26
|
+
- [Google Tag Manager](analytics/google-tag-manager.md) — Google Tag Manager is a flexible tag management tool that lets you deploy and control marketing, analytics, and tracking scripts across your store.
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
## Marketing
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
- [Klaviyo](
|
|
32
|
+
- [Klaviyo](marketing/klaviyo.md) — Klaviyo is a marketing automation platform that allows you to send email campaigns to your customers.
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
## SSO, MFA & Social Login
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
- [Admin Panel SSO & MFA](
|
|
39
|
-
- [Storefront SSO & Social Login](
|
|
38
|
+
- [Admin Panel SSO & MFA](sso-mfa-social-login/admin-dashboard.md) — Learn how to secure your Spree admin panel with SSO and MFA integration, using Microsoft Entra ID as an example.
|
|
39
|
+
- [Storefront SSO & Social Login](sso-mfa-social-login/storefront.md) — Enable customer-facing SSO and social login on your Spree storefront, using Microsoft Entra External ID as an example.
|
|
@@ -65,7 +65,7 @@ Spree's native Adyen integration supports a comprehensive range of features and
|
|
|
65
65
|
|
|
66
66
|
- Support for 3D Secure and other security standards
|
|
67
67
|
- Support for off-session payments
|
|
68
|
-
- Support for Storefront API integration (see the API docs [here](
|
|
68
|
+
- Support for Storefront API integration (see the API docs [here](../../api-reference/storefront/adyen/create-an-adyen-payment-session.md))
|
|
69
69
|
- Accept payments in over 150 currencies
|
|
70
70
|
- Accept Credit Cards, Debit Cards, and Digital Wallets
|
|
71
71
|
- Accept Buy Now, Pay Later (BNPL) payments
|
|
@@ -232,5 +232,5 @@ For production deployments, consider [Meilisearch Cloud](https://www.meilisearch
|
|
|
232
232
|
|
|
233
233
|
## Related Documentation
|
|
234
234
|
|
|
235
|
-
- [Search & Filtering](
|
|
236
|
-
- [Search Providers](
|
|
235
|
+
- [Search & Filtering](../../developer/core-concepts/search-filtering.md) — Store API search reference
|
|
236
|
+
- [Search Providers](../../developer/how-to/custom-search-provider.md) — Architecture and custom providers
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spree/docs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Spree Commerce developer documentation for AI agents and local reference",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "CC-BY-4.0",
|
|
@@ -15,12 +15,17 @@
|
|
|
15
15
|
"url": "https://github.com/spree/spree/issues"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
|
-
"dist/**/*.md"
|
|
18
|
+
"dist/**/*.md",
|
|
19
|
+
"dist/**/*.yaml"
|
|
19
20
|
],
|
|
20
21
|
"scripts": {
|
|
21
22
|
"build": "node scripts/build.js",
|
|
23
|
+
"test": "vitest run",
|
|
22
24
|
"clean": "rm -rf dist"
|
|
23
25
|
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"vitest": "^4.0.18"
|
|
28
|
+
},
|
|
24
29
|
"engines": {
|
|
25
30
|
"node": ">=18.0.0"
|
|
26
31
|
}
|