Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions docs/upgrading-solidus/v4.7.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
sidebar_position: -4.7
---

import MinimalRequirements from "@site/src/theme/MinimalRequirements";
import PRLink from "@site/src/theme/PRLink";

# Solidus v4.7 (2026-04-16)

<MinimalRequirements ruby="3.2" rails="7.2" />

We're excited to announce the release of Solidus v4.7.0! This release brings a new in-memory order updater for improved performance, continued promotions enhancements, and Rails 8.1 support.

## 🚀 Key Highlights

### In-Memory Order Updater

Solidus now has an alternative order updater implementation optimized for reducing database interactions. The team at SuperGood has worked on getting this change ready for production use.

- **Increased performance for order updates** — By default, the new order updater makes fewer write calls to the database. This means that order- and checkout-related controller actions can resolve faster, with fewer round trips to the database server.
- **Order update simulation** — By passing `persist: false` to the in-memory order updater, an order can be recalculated and rolled back to its last state without any database writes. This enables stores to let administrators and customers preview changes to orders before accepting those changes.

To use this you need to opt-in by updating the `order_recalculator_class` in your app configuration.

<PRLink number="5872">In-memory order updater</PRLink>

:::info
We would love to hear if you enable this on your store and have feedback on the implementation!
:::

### Rails 8.1 Support

This release adds support for Rails 8.1, thanks to [Alistair Norman](https://github.com/alistairnorman). Rails 7.2 is now the minimum required version.

<PRLink number="6414">Require Rails 7.2+</PRLink>

### Solidus Promotions

[Martin Meyerhoff](https://github.com/mamhoff) continues to improve the solidus_promotions implementation with a number of enhancements and refactors:

- <PRLink number="6360">Changes to promotion condition API (combining `applicable?` and `eligible?` checks)</PRLink>
- <PRLink number="6430">Model to evaluate promotion eligibility without applying a promotion</PRLink>
- <PRLink number="6422">Updates to promotion migrator to better handle duplicate codes</PRLink>
- <PRLink number="6425">Flatten promotion condition configuration</PRLink>
- <PRLink number="6424">Validate promotion uniqueness per order</PRLink>
- <PRLink number="6357">Deprecate promotion "level"</PRLink>
- <PRLink number="6343">Fix First Order promotion condition to not fail on canceled orders</PRLink>

### Configurable Stock Quantifier

The stock quantifier is now configurable, allowing stores to customize how available stock is calculated for variants.

<PRLink number="6335">Configurable stock quantifier</PRLink>

### Configurable Order Mergeable Scope

The scope used to determine which orders can be merged is now configurable, giving stores more control over order merging behavior during sign-in.

<PRLink number="6384">Configurable Order Mergeable Scope</PRLink>

### Configurable State Change Tracker

The state change tracker is now a configurable class, making it possible to customize or replace how order state changes are tracked.

<PRLink number="6375">Make state change tracker a configurable class</PRLink>

### Recalculate Cart Prices

A new `recalculate_cart_prices` option allows stores to update line item prices when an order is recalculated, useful for handling price changes while a cart is still open.

<PRLink number="6399">Allow to recalculate cart prices</PRLink>

## 📦 Component Updates

### Solidus Core

- **In-Memory Order Updater**: New alternative order updater optimized for fewer database interactions
- **Rails 8.1 Support**: Full compatibility with the latest Rails release
- **Product Filters**: Made product filters easier to override (<PRLink number="6408">PR</PRLink>)

### Solidus Admin

- **Lookbook Fix**: Fixed the Lookbook in sandbox applications (<PRLink number="6417">PR</PRLink>)

## 🔧 Technical Improvements

### Linting & Code Quality

- Upgraded to newest ESLint (v10) (<PRLink number="6420">PR</PRLink>)
- Switched to StandardRB for Ruby linting (<PRLink number="6421">PR</PRLink>)

### Extension Updates

Huge thanks to [Alistair Norman](https://github.com/alistairnorman) for updating CI to GitHub Actions across multiple extensions:

- solidus_subscriptions
- solidus_i18n
- solidus_starter_frontend
- solidus_dev_support

Alistair also added Ruby 4 support to:

- solidus_affirm
- solidus_frontend_bootstrap

## 🔄 Breaking Changes

- Rails 7.2 is now the minimum required Rails version. Applications on Rails 7.0 or 7.1 will need to upgrade before updating Solidus.

---

For the complete list of changes, see the [full changelog](https://github.com/solidusio/solidus/compare/v4.6.0...v4.7.0).
1 change: 1 addition & 0 deletions src/theme/SupportedVersions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';

export default function SupportedVersions() {
const versions = [
{ number: 'v4.7', releaseDate: '2026-04-16' },
{ number: 'v4.6', releaseDate: '2025-09-09' },
{ number: 'v4.5', releaseDate: '2025-02-20' },
{ number: 'v4.4', releaseDate: '2024-11-12' },
Expand Down
6 changes: 6 additions & 0 deletions versioned_docs/version-4.7/advanced-solidus/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"label": "Advanced Solidus",
"position": 4,
"collapsible": true,
"collapsed": true
}
158 changes: 158 additions & 0 deletions versioned_docs/version-4.7/advanced-solidus/custom-authentication.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
---
sidebar_position: 1
needs-diataxis-rewrite: true
---

# Custom authentication

:::info
You can use the official [`solidus_auth_devise`](https://github.com/solidusio/solidus_auth_devise) gem to provide
a `Spree::User` model and basic authentication for Solidus. See its documentation for additional setup instructions.
:::

Solidus requires a `User` model in order to take advantage of all its features. This model can have any name, and
Solidus can integrate with your application's existing authentication system.

In this guide, we'll explore the steps required to create a `User` model from scratch, use an authentication solution
like [Devise ](https://github.com/plataformatec/devise), or integrate your application's existing `User` model.

## Basic requirements

In order to use a custom user model, your model should have:

* **An integer `id` column:** Solidus uses integers for all foreign keys, so you need to use integer IDs in your user
model. You may use other types of IDs by changing the types of the foreign key columns, but this is generally
discouraged.
* **A `password` attribute:** This is needed if you use
`solidus_starter_frontend`, `solidus_frontend` or `solidus_backend`. You can
implement the attribute however you see fit.

This is all you need for now. The rest of the requirements will be implemented in the next steps!

## Preparing your user class

### With the generator

Solidus ships with a generator to prepare and configure your custom user class throughout the application. Just run the
following:

```bash
$ rails g spree:custom_user AmazingStore::User
```

This will do the following:

* Generate a migration to add some required columns to the custom model's table.
* Set `Spree.user_class` to your custom model's class name, so that Solidus knows to use it in associations and
throughout the store.
* Implement some authentication helpers required by `solidus_backend`,
`solidus_starter_frontend` and `solidus_frontend` in
`lib/spree/authentication_helpers.rb`.

At this point, you'll need to migrate your database to add the new columns:

```bash
$ rails db:migrate
```

You may also want to customize the helpers in `lib/spree/authentication_helpers.rb`.

### Without the generator

#### Add the required columns <a id="minimum-requirements"></a>

The first step is to add the columns Solidus expects to the users table:

* `spree_api_key`: a string containing the user's API key. This should be limited to 48 characters.
* `bill_address_id`: an integer containing the ID of the `Spree::Address` that should be used as the user's billing
address.
* `ship_address_id`: an integer containing the ID of the `Spree::Address` that should be used as the user's shipping
address.

You can easily add these with the following migration:

```bash
$ rails g migration AddAuthColumnsToUsers \
spree_api_key:string{48} \
bill_address_id:integer \
ship_address_id:integer
```

Once the migration has been generated, you can migrate the database:

```bash
$ rails db:migrate
```

#### spree\_current\_user helper <a id="spree-em-current-em-user"></a>

If you use `solidus_starter_frontend`, `solidus_frontend` or `solidus_backend`,
you need to provide a `spree_current_user` helper method in your
`ApplicationController`:

```ruby title="app/controllers/application\_controller.rb"
class ApplicationController < ActionController::Base
helper_method :spree_current_user

def spree_current_user
# If your gem already provides a current_user method,
# you may simply wrap it in spree_current_user. If not,
# you'll need some additional custom logic here.
current_user
end

# ...
end
```

#### Add authentication helpers <a id="add-authentication-helpers"></a>

If you use `solidus_starter_frontend`, `solidus_frontend` or `solidus_backend`,
you need to provide authentication helpers so that users can sign up, log in,
and log out:

```ruby title="app/controllers/application\_controller.rb"
class ApplicationController < ActionController::Base
helper_method :spree_login_path
helper_method :spree_signup_path
helper_method :spree_logout_path

def spree_login_path
login_path
end

def spree_signup_path
signup_path
end

def spree_logout_path
logout_path
end

# ...
end
```

## Adding Solidus user methods

The [`Spree::UserMethods` module ](https://github.com/solidusio/solidus/blob/v3.0/core/app/models/concerns/spree/user_methods.rb)
provides extensive integration for a `User` model, creating associations and allowing it to interact with major models
in Solidus like `Spree::Order`.

To add user methods to your `User` model, include `Spree::UserMethods` :

```ruby title="app/models/my\_store/user.rb"
module MyStore
class User
include Spree::UserMethods

# ...
end
end
```

## How-to guides

- [How to sign in to the Solidus API using solidus_auth_devise][how-to-sign-in-to-the-solidus-api-using-solidus_auth_devise]

[how-to-sign-in-to-the-solidus-api-using-solidus_auth_devise]: /how-tos/api/how-to-sign-in-to-the-solidus-api-using-solidus_auth_devise.mdx
Loading