@spree/docs 0.1.177 → 0.1.178

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 (117) hide show
  1. package/dist/developer/cli/quickstart.md +1 -1
  2. package/dist/developer/contributing/creating-an-extension.md +2 -2
  3. package/dist/developer/core-concepts/addresses.md +3 -3
  4. package/dist/developer/core-concepts/architecture.md +4 -4
  5. package/dist/developer/core-concepts/calculators.md +2 -2
  6. package/dist/developer/core-concepts/carts.md +207 -0
  7. package/dist/developer/core-concepts/channels.md +3 -3
  8. package/dist/developer/core-concepts/customers.md +1 -1
  9. package/dist/developer/core-concepts/events.md +1 -1
  10. package/dist/developer/core-concepts/fulfillments.md +278 -0
  11. package/dist/developer/core-concepts/imports-exports.md +6 -18
  12. package/dist/developer/core-concepts/inventory.md +3 -3
  13. package/dist/developer/core-concepts/media.md +1 -1
  14. package/dist/developer/core-concepts/metafields.md +1 -1
  15. package/dist/developer/core-concepts/orders.md +92 -339
  16. package/dist/developer/core-concepts/payments.md +1 -1
  17. package/dist/developer/core-concepts/promotions.md +68 -195
  18. package/dist/developer/core-concepts/returns-exchanges-claims.md +173 -0
  19. package/dist/developer/core-concepts/store-credits-gift-cards.md +16 -18
  20. package/dist/developer/core-concepts/stores.md +1 -1
  21. package/dist/developer/core-concepts/taxes-discounts-fees.md +199 -0
  22. package/dist/developer/core-concepts/taxes.md +3 -3
  23. package/dist/developer/create-spree-app/quickstart.md +1 -1
  24. package/dist/developer/customization/api.md +36 -11
  25. package/dist/developer/customization/configuration.md +207 -37
  26. package/dist/developer/customization/decorators.md +8 -8
  27. package/dist/developer/customization/permissions.md +34 -229
  28. package/dist/developer/customization/quickstart.md +159 -108
  29. package/dist/developer/customization/validations.md +1 -1
  30. package/dist/developer/dashboard/overview.md +1 -1
  31. package/dist/developer/how-to/build-a-b2b-store.md +21 -0
  32. package/dist/developer/how-to/build-a-marketplace.md +25 -0
  33. package/dist/developer/how-to/custom-api-authentication.md +1 -1
  34. package/dist/developer/how-to/custom-delivery-rate-provider.md +242 -0
  35. package/dist/developer/how-to/custom-document-numbers.md +154 -0
  36. package/dist/developer/how-to/custom-order-routing.md +1 -1
  37. package/dist/developer/how-to/custom-payment-method.md +1 -1
  38. package/dist/developer/how-to/custom-promotion.md +76 -115
  39. package/dist/developer/how-to/custom-report.md +2 -2
  40. package/dist/developer/how-to/custom-stock-splitter.md +5 -5
  41. package/dist/developer/how-to/sell-digital-products.md +20 -0
  42. package/dist/developer/multi-tenant/quickstart.md +1 -1
  43. package/dist/developer/providers/dam.md +14 -0
  44. package/dist/developer/providers/erp.md +31 -0
  45. package/dist/developer/providers/fulfillment.md +25 -0
  46. package/dist/developer/{deployment/telemetry.md → providers/observability.md} +1 -1
  47. package/dist/developer/providers/overview.md +44 -0
  48. package/dist/developer/providers/pim.md +25 -0
  49. package/dist/developer/providers/sso.md +20 -0
  50. package/dist/developer/sdk/admin/extending.md +1 -1
  51. package/dist/developer/sdk/admin/quickstart.md +1 -1
  52. package/dist/developer/sdk/admin/resources.md +1 -1
  53. package/dist/developer/sdk/extending.md +1 -1
  54. package/dist/developer/tutorial/admin-api.md +13 -0
  55. package/dist/developer/tutorial/dashboard-plugin.md +14 -0
  56. package/dist/developer/tutorial/events.md +7 -161
  57. package/dist/developer/tutorial/introduction.md +15 -35
  58. package/dist/developer/tutorial/model.md +7 -98
  59. package/dist/developer/tutorial/store-api.md +13 -0
  60. package/dist/developer/tutorial/storefront.md +12 -0
  61. package/dist/developer/tutorial/testing.md +7 -711
  62. package/dist/developer/upgrades/5.6-to-6.0.md +2 -2
  63. package/package.json +1 -1
  64. package/dist/developer/admin/admin.md +0 -214
  65. package/dist/developer/admin/authentication.md +0 -59
  66. package/dist/developer/admin/components.md +0 -711
  67. package/dist/developer/admin/custom-css.md +0 -256
  68. package/dist/developer/admin/custom-javascript.md +0 -116
  69. package/dist/developer/admin/extending-ui.md +0 -1839
  70. package/dist/developer/admin/form-builder.md +0 -444
  71. package/dist/developer/admin/helper-methods.md +0 -531
  72. package/dist/developer/admin/navigation.md +0 -805
  73. package/dist/developer/admin/tables.md +0 -490
  74. package/dist/developer/advanced/adding_spree_to_rails_app.md +0 -92
  75. package/dist/developer/core-concepts/adjustments.md +0 -113
  76. package/dist/developer/core-concepts/reports.md +0 -208
  77. package/dist/developer/core-concepts/shipments.md +0 -307
  78. package/dist/developer/core-concepts/users.md +0 -303
  79. package/dist/developer/customization/authentication.md +0 -100
  80. package/dist/developer/customization/checkout.md +0 -202
  81. package/dist/developer/customization/emails.md +0 -18
  82. package/dist/developer/customization/routes.md +0 -24
  83. package/dist/developer/multi-vendor/installation.md +0 -61
  84. package/dist/developer/multi-vendor/quickstart.md +0 -17
  85. package/dist/developer/tutorial/admin.md +0 -206
  86. package/dist/developer/tutorial/api.md +0 -606
  87. package/dist/developer/tutorial/extending-models.md +0 -393
  88. package/dist/developer/tutorial/sdk.md +0 -170
  89. package/dist/developer/upgrades/2.0-to-2.1.md +0 -46
  90. package/dist/developer/upgrades/2.1-to-2.2.md +0 -59
  91. package/dist/developer/upgrades/2.2-to-2.3.md +0 -44
  92. package/dist/developer/upgrades/2.3-to-2.4.md +0 -42
  93. package/dist/developer/upgrades/3.0-to-3.1.md +0 -47
  94. package/dist/developer/upgrades/3.1-to-3.2.md +0 -34
  95. package/dist/developer/upgrades/3.2-to-3.3.md +0 -70
  96. package/dist/developer/upgrades/3.3-to-3.4.md +0 -36
  97. package/dist/developer/upgrades/3.4-to-3.5.md +0 -44
  98. package/dist/developer/upgrades/3.5-to-3.6.md +0 -40
  99. package/dist/developer/upgrades/3.6-to-3.7.md +0 -62
  100. package/dist/developer/upgrades/3.7-to-4.0.md +0 -152
  101. package/dist/developer/upgrades/4.0-to-4.1.md +0 -92
  102. package/dist/developer/upgrades/4.1-to-4.2.md +0 -109
  103. package/dist/developer/upgrades/4.10-to-5.0.md +0 -131
  104. package/dist/developer/upgrades/4.2-to-4.3.md +0 -100
  105. package/dist/developer/upgrades/4.3-to-4.4.md +0 -125
  106. package/dist/developer/upgrades/4.4-to-4.5.md +0 -94
  107. package/dist/developer/upgrades/4.5-to-4.6.md +0 -119
  108. package/dist/developer/upgrades/4.6-to-4.7.md +0 -39
  109. package/dist/developer/upgrades/4.8-to-4.9.md +0 -24
  110. package/dist/developer/upgrades/4.9-to-4.10.md +0 -24
  111. package/dist/developer/upgrades/4.x-to-4.8.md +0 -52
  112. package/dist/developer/upgrades/5.0-to-5.1.md +0 -28
  113. package/dist/developer/upgrades/5.1-to-5.2.md +0 -131
  114. package/dist/developer/upgrades/5.2-to-5.3.md +0 -338
  115. package/dist/developer/upgrades/5.3-to-5.4.md +0 -277
  116. package/dist/developer/upgrades/5.4-to-5.5.md +0 -301
  117. package/dist/developer/upgrades/5.5-to-5.6.md +0 -207
@@ -4,7 +4,7 @@ description: Guide to upgrading a Spree 5.6 application to Spree 6.0
4
4
  hidden: true
5
5
  ---
6
6
 
7
- > **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.6](5.5-to-5.6.md). Spree 6.0 requires **Rails 8.1** and is the designated breaking-change window for the platform — read the behavioral changes section even if your upgrade runs clean.
7
+ > **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.6](/v5/developer/upgrades/5.5-to-5.6). Spree 6.0 requires **Rails 8.1** and is the designated breaking-change window for the platform — read the behavioral changes section even if your upgrade runs clean.
8
8
 
9
9
  Spree 6.0 is a major release. The headline changes:
10
10
 
@@ -440,7 +440,7 @@ buckets, and only the last needs this hook:
440
440
 
441
441
  | What you were adding | Where it goes in 6.0 |
442
442
  | --- | --- |
443
- | A merchant-managed field (text, number, dropdown) | [Custom Fields](../core-concepts/custom-fields.md) — no code, and filterable/sortable |
443
+ | A merchant-managed field (text, number, dropdown) | [Custom Fields](../core-concepts/metafields.md) — no code, and filterable/sortable |
444
444
  | Config for an STI type you register (promotion rule, delivery method rule, …) | `additional_permitted_attributes` on that subclass, as before — unchanged |
445
445
  | A real database column your extension added to a core model | `additional_permitted_attributes` on the model |
446
446
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spree/docs",
3
- "version": "0.1.177",
3
+ "version": "0.1.178",
4
4
  "description": "Spree Commerce developer documentation for AI agents and local reference",
5
5
  "type": "module",
6
6
  "license": "CC-BY-4.0",
@@ -1,214 +0,0 @@
1
- ---
2
- title: Admin Dashboard
3
- sidebarTitle: Overview
4
- description: Customize and extend the Spree Admin Dashboard to manage products, orders, customers, promotions, and store settings for your ecommerce platform.
5
- ---
6
-
7
- The Spree Admin Dashboard is a full-featured administration interface for managing your e-commerce store.
8
-
9
- <img src="/images/spree_admin_dashboard.png" alt="Spree Admin Dashboard" />
10
-
11
- ## What You Can Do
12
-
13
- The Admin Dashboard allows store administrators to manage:
14
-
15
- - **Products** - Create and manage products, variants, images, and inventory
16
- - **Orders** - Process orders, refunds, and shipments
17
- - **Customers** - View customer accounts and order history
18
- - **Promotions** - Create discounts, coupon codes, and special offers
19
- - **Settings** - Configure store settings, shipping, taxes, and payments
20
-
21
- ## Customization Options
22
-
23
- As a developer, you can fully customize the Admin Dashboard:
24
-
25
-
26
- - [Add New Sections](../tutorial/admin.md) — Create entirely new admin pages for custom features like Brands, Vendors, or any custom model
27
- - [Extend Existing UI](extending-ui.md) — Inject custom fields, buttons, and sections into existing admin pages
28
- - [Custom Navigation](navigation.md) — Add menu items to the sidebar or create custom navigation structures
29
- - [Custom Styling](custom-css.md) — Add your own CSS to match your brand or modify the look and feel
30
-
31
-
32
- ## Architecture Overview
33
-
34
- Spree Admin follows standard Rails conventions with some Spree-specific patterns:
35
-
36
- ```
37
- app/
38
- ├── controllers/
39
- │ └── spree/
40
- │ └── admin/
41
- │ └── products_controller.rb # Your custom controllers
42
- ├── views/
43
- │ └── spree/
44
- │ └── admin/
45
- │ └── products/
46
- │ ├── index.html.erb # List view
47
- │ ├── _form.html.erb # Shared form partial
48
- │ └── _table_row.html.erb # Table row partial
49
- ├── helpers/
50
- │ └── spree/
51
- │ └── admin/
52
- │ └── products_helper.rb # View helpers
53
- └── assets/
54
- └── tailwind/
55
- └── spree_admin.css # Custom Tailwind styles
56
- ```
57
-
58
- ## Key Concepts
59
-
60
- ### Controllers
61
-
62
- Admin controllers inherit from `Spree::Admin::ResourceController` which provides:
63
-
64
- - Full CRUD operations (index, new, create, edit, update, destroy)
65
- - Automatic authorization checks
66
- - Flash messages and redirects
67
- - Search and filtering with Ransack
68
-
69
- ```ruby
70
- # app/controllers/spree/admin/brands_controller.rb
71
- module Spree
72
- module Admin
73
- class BrandsController < ResourceController
74
- # That's it! CRUD is handled automatically.
75
- # Override methods only when needed.
76
- end
77
- end
78
- end
79
- ```
80
-
81
- > **INFO:** Learn more about creating admin sections in the [Admin Dashboard Tutorial](../tutorial/admin.md).
82
-
83
- ### Views & Templates
84
-
85
- Views use standard Rails ERB templates with Spree's [Form Builder](form-builder.md) and [Components](components.md):
86
-
87
- ```erb
88
- <%# app/views/spree/admin/brands/_form.html.erb %>
89
- <div class="card mb-6">
90
- <div class="card-header">
91
- <h5 class="card-title"><%= Spree.t(:general_settings) %></h5>
92
- </div>
93
- <div class="card-body">
94
- <%= f.spree_text_field :name, required: true %>
95
- <%= f.spree_text_area :description %>
96
- <%= f.spree_file_field :logo, width: 300, height: 300 %>
97
- <%= f.spree_check_box :active %>
98
- </div>
99
- </div>
100
- ```
101
-
102
- ### JavaScript & Interactivity
103
-
104
- Spree Admin uses [Hotwire](https://hotwire.dev/) (Turbo + Stimulus) for interactivity:
105
-
106
- - **Turbo Drive** - Fast page navigation without full reloads
107
- - **Turbo Frames** - Update parts of the page independently
108
- - **Turbo Streams** - Real-time updates over WebSocket
109
- - **Stimulus** - Lightweight JavaScript controllers
110
-
111
- ```erb
112
- <%# Using Stimulus controllers %>
113
- <div data-controller="dropdown">
114
- <button data-action="dropdown#toggle">Menu</button>
115
- <div data-dropdown-target="menu">...</div>
116
- </div>
117
- ```
118
-
119
- > **INFO:** Add custom JavaScript using [Stimulus controllers](custom-javascript.md).
120
-
121
- ### Styling
122
-
123
- The Admin Dashboard uses [Tailwind CSS v4](https://tailwindcss.com/) for styling. You can:
124
-
125
- - Use Tailwind utility classes directly in your views
126
- - Override theme variables (colors, spacing, typography)
127
- - Add custom components using `@layer components`
128
-
129
- ```erb
130
- <%# Using Tailwind utility classes in views %>
131
- <div class="bg-white rounded-lg shadow-sm border border-zinc-200 p-4">
132
- <h3 class="text-lg font-bold text-zinc-900">My Custom Card</h3>
133
- <p class="text-sm text-zinc-600 mt-2">Card content here</p>
134
- </div>
135
- ```
136
-
137
- > **INFO:** Learn how to customize styles in [Custom CSS](custom-css.md).
138
-
139
- ## Quick Reference
140
-
141
- ### Available Tools
142
-
143
- | Tool | Purpose | Documentation |
144
- |------|---------|---------------|
145
- | Form Builder | Create consistent forms with validation | [Form Builder](form-builder.md) |
146
- | Components | Dropdowns, dialogs, icons, badges, etc. | [Components](components.md) |
147
- | Helper Methods | Navigation, links, utilities | [Helper Methods](helper-methods.md) |
148
- | UI Extensions | Inject content into existing pages | [Extending UI](extending-ui.md) |
149
-
150
- ### Common Tasks
151
-
152
- | Task | How To |
153
- |------|--------|
154
- | Add a new admin page | Use the scaffold generator: `bin/rails g spree:admin:scaffold Spree::Brand` |
155
- | Add sidebar navigation | Use `Spree.admin.navigation.sidebar.add` in an initializer |
156
- | Add form fields | Use `f.spree_text_field`, `f.spree_select`, etc. |
157
- | Show flash messages | They're automatic with `ResourceController` |
158
- | Check permissions | Use `can?(:update, @product)` in views |
159
-
160
- ### Generator Commands
161
-
162
-
163
- ```bash Spree CLI (Docker)
164
- # Generate a complete admin section (controller, views, routes)
165
- spree generate spree:admin:scaffold Spree::Brand
166
-
167
- # Generate just a controller
168
- spree generate controller Spree::Admin::Brands --skip-routes
169
- ```
170
-
171
- ```bash Without Spree CLI
172
- # Generate a complete admin section (controller, views, routes)
173
- bin/rails g spree:admin:scaffold Spree::Brand
174
-
175
- # Generate just a controller
176
- bin/rails g controller Spree::Admin::Brands --skip-routes
177
- ```
178
-
179
-
180
- ## Authentication & Authorization
181
-
182
- ### Authentication
183
-
184
- Admin users must be authenticated to access the dashboard. Spree supports:
185
-
186
- - Built-in Devise authentication
187
- - Custom authentication adapters
188
- - SSO integration
189
-
190
- > **INFO:** See [Authentication](authentication.md) for setup details.
191
-
192
- ### Authorization
193
-
194
- Spree uses [CanCanCan](https://github.com/CanCanCommunity/cancancan) for authorization:
195
-
196
- ```ruby
197
- # Check permissions in controllers
198
- authorize! :update, @product
199
-
200
- # Check permissions in views
201
- <% if can?(:destroy, @product) %>
202
- <%= link_to_delete(@product) %>
203
- <% end %>
204
- ```
205
-
206
- > **INFO:** See [Permissions](../customization/permissions.md) for defining custom abilities.
207
-
208
- ## Next Steps
209
-
210
-
211
- - [Tutorial: Build Admin UI](../tutorial/admin.md) — Step-by-step guide to creating a complete admin section
212
- - [Form Builder](form-builder.md) — Learn all available form field helpers
213
- - [Components](components.md) — Explore UI components like dropdowns, dialogs, and icons
214
- - [Extending UI](extending-ui.md) — Add custom content to existing admin pages
@@ -1,59 +0,0 @@
1
- ---
2
- title: Admin Panel Authentication
3
- sidebarTitle: Authentication
4
- description: How to customize the Spree admin panel authentication
5
- ---
6
-
7
- Spree allows you to use a different model for the admin panel than the storefront (that's the default since Spree 5.2).
8
- Here you can find how to customize the admin panel authentication to use a different model.
9
-
10
- Let's assume you have an existing `AdminUser` model in your application and you're using Devise for authentication.
11
-
12
- In `config/initializers/spree.rb` file, add the following line:
13
-
14
- ```ruby
15
- Spree.admin_user_class = 'AdminUser'
16
- ```
17
-
18
- This will tell Spree to use your `AdminUser` model for the admin panel. You will also need to add the following line in that model file:
19
-
20
- ```ruby
21
- include Spree::UserMethods
22
- ```
23
-
24
- In your `config/initializers/routes.rb` file, you will need to define devise routes for the 2nd model:
25
-
26
- ```ruby
27
- Spree::Core::Engine.routes.prepend_routes do
28
- # Admin authentication
29
- devise_for(
30
- Spree.admin_user_class.model_name.singular_route_key,
31
- class_name: Spree.admin_user_class.to_s,
32
- controllers: {
33
- sessions: 'spree/admin/user_sessions',
34
- passwords: 'spree/admin/user_passwords'
35
- },
36
- skip: :registrations,
37
- path: :admin_user,
38
- router_name: :spree
39
- )
40
- end
41
- ```
42
-
43
- And now in your `lib/spree/authentication_helpers.rb` file, please replace the following lines:
44
-
45
- ```diff
46
- def spree_admin_login_path(opts = {})
47
- - spree_login_path(opts)
48
- + new_admin_user_session_path(opts)
49
- end
50
-
51
- def spree_admin_logout_path(opts = {})
52
- - spree_logout_path(opts)
53
- + destroy_admin_user_session_path(opts)
54
- end
55
- ```
56
-
57
- Now when attempting to access the admin panel, you will be redirected to the dedicated admin panel login page.
58
-
59
- ![Admin panel login page](/images/developer/admin/admin_panel_login.png)