@spree/docs 0.1.176 → 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.
- package/dist/api-reference/store.yaml +48 -48
- package/dist/developer/cli/quickstart.md +1 -1
- package/dist/developer/contributing/creating-an-extension.md +2 -2
- package/dist/developer/core-concepts/addresses.md +3 -3
- package/dist/developer/core-concepts/architecture.md +4 -4
- package/dist/developer/core-concepts/calculators.md +2 -2
- package/dist/developer/core-concepts/carts.md +207 -0
- package/dist/developer/core-concepts/channels.md +3 -3
- package/dist/developer/core-concepts/customers.md +1 -1
- package/dist/developer/core-concepts/events.md +1 -1
- package/dist/developer/core-concepts/fulfillments.md +278 -0
- package/dist/developer/core-concepts/imports-exports.md +6 -18
- package/dist/developer/core-concepts/inventory.md +3 -3
- package/dist/developer/core-concepts/media.md +1 -1
- package/dist/developer/core-concepts/metafields.md +1 -1
- package/dist/developer/core-concepts/orders.md +92 -339
- package/dist/developer/core-concepts/payments.md +1 -1
- package/dist/developer/core-concepts/promotions.md +68 -195
- package/dist/developer/core-concepts/returns-exchanges-claims.md +173 -0
- package/dist/developer/core-concepts/store-credits-gift-cards.md +16 -18
- package/dist/developer/core-concepts/stores.md +1 -1
- package/dist/developer/core-concepts/taxes-discounts-fees.md +199 -0
- package/dist/developer/core-concepts/taxes.md +3 -3
- package/dist/developer/create-spree-app/quickstart.md +1 -1
- package/dist/developer/customization/api.md +36 -11
- package/dist/developer/customization/configuration.md +207 -37
- package/dist/developer/customization/decorators.md +8 -8
- package/dist/developer/customization/permissions.md +34 -229
- package/dist/developer/customization/quickstart.md +159 -108
- package/dist/developer/customization/validations.md +1 -1
- package/dist/developer/dashboard/overview.md +1 -1
- package/dist/developer/how-to/build-a-b2b-store.md +21 -0
- package/dist/developer/how-to/build-a-marketplace.md +25 -0
- package/dist/developer/how-to/custom-api-authentication.md +1 -1
- package/dist/developer/how-to/custom-delivery-rate-provider.md +242 -0
- package/dist/developer/how-to/custom-document-numbers.md +154 -0
- package/dist/developer/how-to/custom-order-routing.md +1 -1
- package/dist/developer/how-to/custom-payment-method.md +1 -1
- package/dist/developer/how-to/custom-promotion.md +76 -115
- package/dist/developer/how-to/custom-report.md +2 -2
- package/dist/developer/how-to/custom-stock-splitter.md +5 -5
- package/dist/developer/how-to/sell-digital-products.md +20 -0
- package/dist/developer/multi-tenant/quickstart.md +1 -1
- package/dist/developer/providers/dam.md +14 -0
- package/dist/developer/providers/erp.md +31 -0
- package/dist/developer/providers/fulfillment.md +25 -0
- package/dist/developer/{deployment/telemetry.md → providers/observability.md} +1 -1
- package/dist/developer/providers/overview.md +44 -0
- package/dist/developer/providers/pim.md +25 -0
- package/dist/developer/providers/sso.md +20 -0
- package/dist/developer/sdk/admin/extending.md +1 -1
- package/dist/developer/sdk/admin/quickstart.md +1 -1
- package/dist/developer/sdk/admin/resources.md +1 -1
- package/dist/developer/sdk/extending.md +1 -1
- package/dist/developer/tutorial/admin-api.md +13 -0
- package/dist/developer/tutorial/dashboard-plugin.md +14 -0
- package/dist/developer/tutorial/events.md +7 -161
- package/dist/developer/tutorial/introduction.md +15 -35
- package/dist/developer/tutorial/model.md +7 -98
- package/dist/developer/tutorial/store-api.md +13 -0
- package/dist/developer/tutorial/storefront.md +12 -0
- package/dist/developer/tutorial/testing.md +7 -711
- package/dist/developer/upgrades/5.6-to-6.0.md +2 -2
- package/package.json +1 -1
- package/dist/developer/admin/admin.md +0 -214
- package/dist/developer/admin/authentication.md +0 -59
- package/dist/developer/admin/components.md +0 -711
- package/dist/developer/admin/custom-css.md +0 -256
- package/dist/developer/admin/custom-javascript.md +0 -116
- package/dist/developer/admin/extending-ui.md +0 -1839
- package/dist/developer/admin/form-builder.md +0 -444
- package/dist/developer/admin/helper-methods.md +0 -531
- package/dist/developer/admin/navigation.md +0 -805
- package/dist/developer/admin/tables.md +0 -490
- package/dist/developer/advanced/adding_spree_to_rails_app.md +0 -92
- package/dist/developer/core-concepts/adjustments.md +0 -113
- package/dist/developer/core-concepts/reports.md +0 -208
- package/dist/developer/core-concepts/shipments.md +0 -307
- package/dist/developer/core-concepts/users.md +0 -303
- package/dist/developer/customization/authentication.md +0 -100
- package/dist/developer/customization/checkout.md +0 -202
- package/dist/developer/customization/emails.md +0 -18
- package/dist/developer/customization/routes.md +0 -24
- package/dist/developer/multi-vendor/installation.md +0 -61
- package/dist/developer/multi-vendor/quickstart.md +0 -17
- package/dist/developer/tutorial/admin.md +0 -206
- package/dist/developer/tutorial/api.md +0 -606
- package/dist/developer/tutorial/extending-models.md +0 -393
- package/dist/developer/tutorial/sdk.md +0 -170
- package/dist/developer/upgrades/2.0-to-2.1.md +0 -46
- package/dist/developer/upgrades/2.1-to-2.2.md +0 -59
- package/dist/developer/upgrades/2.2-to-2.3.md +0 -44
- package/dist/developer/upgrades/2.3-to-2.4.md +0 -42
- package/dist/developer/upgrades/3.0-to-3.1.md +0 -47
- package/dist/developer/upgrades/3.1-to-3.2.md +0 -34
- package/dist/developer/upgrades/3.2-to-3.3.md +0 -70
- package/dist/developer/upgrades/3.3-to-3.4.md +0 -36
- package/dist/developer/upgrades/3.4-to-3.5.md +0 -44
- package/dist/developer/upgrades/3.5-to-3.6.md +0 -40
- package/dist/developer/upgrades/3.6-to-3.7.md +0 -62
- package/dist/developer/upgrades/3.7-to-4.0.md +0 -152
- package/dist/developer/upgrades/4.0-to-4.1.md +0 -92
- package/dist/developer/upgrades/4.1-to-4.2.md +0 -109
- package/dist/developer/upgrades/4.10-to-5.0.md +0 -131
- package/dist/developer/upgrades/4.2-to-4.3.md +0 -100
- package/dist/developer/upgrades/4.3-to-4.4.md +0 -125
- package/dist/developer/upgrades/4.4-to-4.5.md +0 -94
- package/dist/developer/upgrades/4.5-to-4.6.md +0 -119
- package/dist/developer/upgrades/4.6-to-4.7.md +0 -39
- package/dist/developer/upgrades/4.8-to-4.9.md +0 -24
- package/dist/developer/upgrades/4.9-to-4.10.md +0 -24
- package/dist/developer/upgrades/4.x-to-4.8.md +0 -52
- package/dist/developer/upgrades/5.0-to-5.1.md +0 -28
- package/dist/developer/upgrades/5.1-to-5.2.md +0 -131
- package/dist/developer/upgrades/5.2-to-5.3.md +0 -338
- package/dist/developer/upgrades/5.3-to-5.4.md +0 -277
- package/dist/developer/upgrades/5.4-to-5.5.md +0 -301
- package/dist/developer/upgrades/5.5-to-5.6.md +0 -207
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Spree Multi Vendor Installation
|
|
3
|
-
sidebarTitle: Installation
|
|
4
|
-
description: Install and configure Spree Multi-Vendor to launch a marketplace with multiple vendors, including prerequisites, gem setup, license keys, and vendor onboarding.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
> **WARNING:** This installation instructions assume you have purchased the [Spree Enterprise Edition license](https://spreecommerce.org/pricing).
|
|
8
|
-
|
|
9
|
-
## Prerequisites
|
|
10
|
-
|
|
11
|
-
* You need to be on Spree 5.1+, we recommend using [spree_starter](https://github.com/spree/spree_starter) as a base for your application
|
|
12
|
-
* You need to have 2 environment variables set:
|
|
13
|
-
* `KEYGEN_ACCOUNT_ID`
|
|
14
|
-
* `KEYGEN_LICENSE_KEY`
|
|
15
|
-
* We support both PostgreSQL and MySQL databases
|
|
16
|
-
* Redis/Valkey for background jobs
|
|
17
|
-
|
|
18
|
-
> **INFO:** Environment variables will be provided to you after purchasing the [Spree Enterprise Edition license](https://spreecommerce.org/pricing).
|
|
19
|
-
|
|
20
|
-
> **WARNING:** You will need to add these environment variables to your CI/CD pipeline and production environments.
|
|
21
|
-
|
|
22
|
-
## Installing gems
|
|
23
|
-
|
|
24
|
-
1. Add the following code to your `Gemfile`:
|
|
25
|
-
|
|
26
|
-
```ruby
|
|
27
|
-
source "https://license:#{ENV['KEYGEN_LICENSE_KEY']}@rubygems.pkg.keygen.sh/#{ENV['KEYGEN_ACCOUNT_ID']}" do
|
|
28
|
-
gem 'spree_enterprise'
|
|
29
|
-
gem 'spree_multi_vendor'
|
|
30
|
-
end
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
2. Install gems:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
```bash Spree CLI (Docker)
|
|
38
|
-
spree bundle install
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
```bash Without Spree CLI
|
|
42
|
-
bundle install
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
3. Run generators:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
```bash Spree CLI (Docker)
|
|
52
|
-
spree generate spree_enterprise:install && spree generate spree_multi_vendor:install
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
```bash Without Spree CLI
|
|
56
|
-
bin/rails g spree_enterprise:install && bin/rails g spree_multi_vendor:install
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
> **INFO:** This will copy and run migrations for `spree_enterprise` and `spree_multi_vendor` gems.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Building a Multi-Vendor Marketplace with Spree
|
|
3
|
-
sidebarTitle: Quickstart
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
If you want to have a true multi-vendor marketplace, you will need to purchase [Enterprise Edition license](https://spreecommerce.org/pricing) which includes `spree_multi_vendor` gem providing full multi-vendor support.
|
|
7
|
-
|
|
8
|
-
## What is included in `spree_multi_vendor`
|
|
9
|
-
|
|
10
|
-
1. **Ability to invite and manage vendors**, their products and orders
|
|
11
|
-
2. Full fledged **vendor dashboard** where vendors can self-serve orders, products, manage their team, etc.
|
|
12
|
-
3. White-label **Shopify Sales Channel application** allowing vendors to connect their Shopify stores, import products, shipping rates and receive orders to fulfill them like a regular order in their Shopify store.
|
|
13
|
-
4. White-label **WooCommerce application** allowing vendors to connect their WooCommerce stores, import products, shipping rates and receive orders to fulfill them like a regular order in their WooCommerce store
|
|
14
|
-
5. **Stripe Connect** integration allowing vendors to receive payments directly to their Stripe accounts, split payments between marketplace and vendors, automated payouts and more
|
|
15
|
-
6. **Multi-party checkout** allowing customers to checkout with multiple vendors, split payments between them and receive separate invoices for each vendor
|
|
16
|
-
7. **Flexible permission system** to tailor the marketplace to your needs (eg. disable/enable vendor panel features)
|
|
17
|
-
8. **Vendor API** endpoints to allow vendors to manage their products, orders, etc.
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Admin Dashboard
|
|
3
|
-
description: Scaffold the Spree admin UI for the Brands resource and add a rich text description editor, an Active Storage logo upload, and a custom table column.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
> **NOTE:** This is a backend customization. You need to perform it in the `backend` directory if you used `create-spree-app` to set up your Spree application.
|
|
7
|
-
|
|
8
|
-
Now that we've created the `Brand` model, let's create an Admin Dashboard interface so admins can manage brands — including editing the rich text description and uploading the logo.
|
|
9
|
-
|
|
10
|
-
## Step 1: Scaffold the Admin UI
|
|
11
|
-
|
|
12
|
-
The Admin Scaffold generator creates a complete admin section for a resource:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```bash Spree CLI (Docker)
|
|
16
|
-
spree generate spree:admin:scaffold Spree::Brand
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
```bash Without Spree CLI
|
|
20
|
-
bin/rails g spree:admin:scaffold Spree::Brand
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
This will create the following files:
|
|
25
|
-
|
|
26
|
-
| File Type | Path | Description |
|
|
27
|
-
|-----------|------|-------------|
|
|
28
|
-
| Controller | `app/controllers/spree/admin/brands_controller.rb` | Handles the logic for the brands resource. |
|
|
29
|
-
| View | `app/views/spree/admin/brands/index.html.erb` | Displays the list of brands using the tables system. |
|
|
30
|
-
| View | `app/views/spree/admin/brands/new.html.erb` | Displays the new brand form. |
|
|
31
|
-
| View | `app/views/spree/admin/brands/edit.html.erb` | Displays the edit brand form. |
|
|
32
|
-
| Partial | `app/views/spree/admin/brands/_form.html.erb` | The form partial used in new and edit views. |
|
|
33
|
-
| Initializer | `config/initializers/spree_admin_brands_table.rb` | Registers the table with columns for the index view. |
|
|
34
|
-
| Initializer | `config/initializers/spree_admin_brands_navigation.rb` | Adds navigation to the admin sidebar. |
|
|
35
|
-
|
|
36
|
-
It will also automatically add the following routes to your `config/routes.rb` file:
|
|
37
|
-
|
|
38
|
-
```ruby config/routes.rb
|
|
39
|
-
namespace :admin do
|
|
40
|
-
resources :brands
|
|
41
|
-
end
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
You will now be able to access the brands resource at `http://localhost:3000/admin/brands` in your browser. To reference this route in your code, you can use the `spree.admin_brands_path` helper.
|
|
45
|
-
|
|
46
|
-
## Step 2: Add the Description Editor and Logo Upload
|
|
47
|
-
|
|
48
|
-
The generated form only knows about the `name` column. Let's add the rich text editor for `description` and the upload field for `logo` using Spree's [admin form builder](../admin/form-builder.md):
|
|
49
|
-
|
|
50
|
-
```erb app/views/spree/admin/brands/_form.html.erb {4,9-16}
|
|
51
|
-
<div class="card mb-6">
|
|
52
|
-
<div class="card-body">
|
|
53
|
-
<%= f.spree_text_field :name, required: true, autofocus: true %>
|
|
54
|
-
<%= f.spree_rich_text_area :description %>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
|
|
58
|
-
<div class="card mb-6">
|
|
59
|
-
<div class="card-header">
|
|
60
|
-
<h5 class="card-title"><%= Spree.t(:logo) %></h5>
|
|
61
|
-
</div>
|
|
62
|
-
<div class="card-body">
|
|
63
|
-
<%= f.spree_file_field :logo, width: 300, height: 300 %>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
- **`spree_rich_text_area`** renders a WYSIWYG editor (Trix) for the Action Text description.
|
|
69
|
-
- **`spree_file_field`** handles drag-and-drop upload, image preview, and direct upload to storage. Add `crop: true` to enable image cropping with a recommended-size indicator.
|
|
70
|
-
|
|
71
|
-
Then permit the two new attributes in the controller:
|
|
72
|
-
|
|
73
|
-
```ruby app/controllers/spree/admin/brands_controller.rb {7-11}
|
|
74
|
-
module Spree
|
|
75
|
-
module Admin
|
|
76
|
-
class BrandsController < ResourceController
|
|
77
|
-
private
|
|
78
|
-
|
|
79
|
-
def permitted_resource_params
|
|
80
|
-
params.require(:brand).permit(
|
|
81
|
-
:name,
|
|
82
|
-
:description,
|
|
83
|
-
:logo
|
|
84
|
-
)
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Open `http://localhost:3000/admin/brands/new`, create a brand with a formatted description and a logo — everything saves through the standard form.
|
|
92
|
-
|
|
93
|
-
## Step 3: Customize the Table Columns
|
|
94
|
-
|
|
95
|
-
The scaffold generator creates a table initializer at `config/initializers/spree_admin_brands_table.rb` with default columns:
|
|
96
|
-
|
|
97
|
-
```ruby config/initializers/spree_admin_brands_table.rb
|
|
98
|
-
Rails.application.config.after_initialize do
|
|
99
|
-
Spree.admin.tables.register(:brands, model_class: Spree::Brand, search_param: :name_cont)
|
|
100
|
-
|
|
101
|
-
Spree.admin.tables.brands.add :name,
|
|
102
|
-
label: :name,
|
|
103
|
-
type: :link,
|
|
104
|
-
sortable: true,
|
|
105
|
-
filterable: true,
|
|
106
|
-
default: true,
|
|
107
|
-
position: 10
|
|
108
|
-
|
|
109
|
-
Spree.admin.tables.brands.add :created_at,
|
|
110
|
-
label: :created_at,
|
|
111
|
-
type: :datetime,
|
|
112
|
-
sortable: true,
|
|
113
|
-
filterable: true,
|
|
114
|
-
default: true,
|
|
115
|
-
position: 20
|
|
116
|
-
|
|
117
|
-
Spree.admin.tables.brands.add :updated_at,
|
|
118
|
-
label: :updated_at,
|
|
119
|
-
type: :datetime,
|
|
120
|
-
sortable: true,
|
|
121
|
-
filterable: true,
|
|
122
|
-
default: false,
|
|
123
|
-
position: 30
|
|
124
|
-
end
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Show the logo next to the name
|
|
128
|
-
|
|
129
|
-
To render the logo thumbnail in the name column — the same pattern the Products table uses — switch the column to a custom partial:
|
|
130
|
-
|
|
131
|
-
```ruby config/initializers/spree_admin_brands_table.rb
|
|
132
|
-
Spree.admin.tables.brands.add :name,
|
|
133
|
-
label: :name,
|
|
134
|
-
type: :custom,
|
|
135
|
-
partial: 'spree/admin/tables/columns/brand_name',
|
|
136
|
-
sortable: true,
|
|
137
|
-
filterable: true,
|
|
138
|
-
default: true,
|
|
139
|
-
position: 10
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
And create the partial:
|
|
143
|
-
|
|
144
|
-
```erb app/views/spree/admin/tables/columns/_brand_name.html.erb
|
|
145
|
-
<%# locals: (record:, column:, value:) %>
|
|
146
|
-
<%= link_to spree.edit_admin_brand_path(record), class: 'flex items-center gap-3 no-underline', data: { turbo_frame: '_top' } do %>
|
|
147
|
-
<% if record.logo.attached? %>
|
|
148
|
-
<%= spree_image_tag record.logo, width: 48, height: 48, class: 'rounded' %>
|
|
149
|
-
<% end %>
|
|
150
|
-
<span class="text-gray-900 font-medium"><%= record.name %></span>
|
|
151
|
-
<% end %>
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
> **INFO:** For complete table customization options including column types, filtering, sorting, and bulk actions, see the [Admin Tables](../admin/tables.md) guide.
|
|
155
|
-
|
|
156
|
-
## Step 4: Customize Navigation
|
|
157
|
-
|
|
158
|
-
The scaffold generator also creates a navigation initializer at `config/initializers/spree_admin_brands_navigation.rb`:
|
|
159
|
-
|
|
160
|
-
```ruby config/initializers/spree_admin_brands_navigation.rb
|
|
161
|
-
Rails.application.config.after_initialize do
|
|
162
|
-
Spree.admin.navigation.sidebar.add :brands,
|
|
163
|
-
label: :brands,
|
|
164
|
-
url: :admin_brands_path,
|
|
165
|
-
icon: 'list',
|
|
166
|
-
position: 55,
|
|
167
|
-
active: -> { controller_name == 'brands' },
|
|
168
|
-
if: -> { can?(:manage, Spree::Brand) }
|
|
169
|
-
end
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
You can customize the icon and position to fit your needs. For example, to use the "award" icon and place it between Products (30) and Customers (40):
|
|
173
|
-
|
|
174
|
-
```ruby
|
|
175
|
-
Spree.admin.navigation.sidebar.add :brands,
|
|
176
|
-
label: :brands,
|
|
177
|
-
url: :admin_brands_path,
|
|
178
|
-
icon: 'award',
|
|
179
|
-
position: 35,
|
|
180
|
-
active: -> { controller_name == 'brands' },
|
|
181
|
-
if: -> { can?(:manage, Spree::Brand) }
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Adding to an Existing Submenu
|
|
185
|
-
|
|
186
|
-
To add "Brands" to the Products submenu instead, use the `parent` option:
|
|
187
|
-
|
|
188
|
-
```ruby config/initializers/spree_admin_brands_navigation.rb
|
|
189
|
-
Rails.application.config.after_initialize do
|
|
190
|
-
Spree.admin.navigation.sidebar.add :brands,
|
|
191
|
-
label: :brands,
|
|
192
|
-
url: :admin_brands_path,
|
|
193
|
-
position: 50,
|
|
194
|
-
parent: :products,
|
|
195
|
-
active: -> { controller_name == 'brands' },
|
|
196
|
-
if: -> { can?(:manage, Spree::Brand) }
|
|
197
|
-
end
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
After restarting your server, you'll see the new "Brands" navigation link in the admin sidebar!
|
|
201
|
-
|
|
202
|
-
> **INFO:** For complete navigation API documentation including all available options, submenu creation, badges, and more, see the [Admin Navigation](../admin/navigation.md) guide. The form helpers used in Step 2 are documented in [Form Builder](../admin/form-builder.md) and [Components](../admin/components.md).
|
|
203
|
-
|
|
204
|
-
## Next Step
|
|
205
|
-
|
|
206
|
-
Brands are manageable in the admin. Now let's connect them to Products: [Extending Core Models](extending-models.md).
|