Return Authorization Rewrite
Return Authorizations have received a major rewrite, and can be read more about in the updated Returning Orders guide.
The previous return authorization code has been extracted into an extension if you would like to continue using it: https://github.com/spree-contrib/spree_legacy_return_authorizations
HTML Email Templates
Guides moved into core repository
The previous spree-guides repository has been merged into the Spree Core repository. Any documentation updates to this website should now be submitted with pull requests to https://github.com/spree/spree
Read the upgrade guide
For information about upgrading a basic spree store, please read the 2.3 to 2.4 upgrade guide.
If you have implemented your own authentication system instead of using spree_auth_devise, or you have implemented your own adjustment source please ensure you change your concerns to the new namespace:
Spree::Core::AdjustmentSource => Spree::AdjustmentSource Spree::Core::CalculatedAdjustments => Spree::CalculatedAdjustments Spree::Core::UserAddress => Spree::UserAddress Spree::Core::UserPaymentSource => Spree::UserPaymentSource
Also please review each of the noteable changes, and ensure your customizations or extensions are not effected. If you are effected by a change, and have any of your own tips please submit a PR to help the next person!
You can view the full changes using Github Compare
The admin order creation/edit process now closely matches the frontend by allowing a separate cart and shipments page.
Tyler Smart (tesserakt)
Add authorize_payments! and capture_payments! to the public interface of orders.
Spree no longer holds aws-sdk as a core dependency. In case you use it you need to add it to your Gemfile. See paperclip README for reference on scenarios where this is needed https://github.com/thoughtbot/paperclip/tree/v4.1.1#understanding-storage
Washigton L Braga Jr
Added Spree::Config.auto_capture_on_dispatch that when set to true will cause shipments to advance to ready state upon successfully authorizing payment for the order. As each shipment is marked shipped the shipment’s total will be captured from the authorization. Fixes #4727
actionable?defines if a promotion action can be applied to a specific line item. This can be used to customize which line items can accept a promotion action by defining its logic within the promotion rule rather than relying on Spree’s default behaviour. Fixes #5036
Refactored Stock::Coordinator to optionally accept a list of inventory units for an order so that shipments can be created for an order that do not comprise only of the order’s line items.
Default ship and bill addresses are now saved and restored in callbacks. This makes the default address functionality available to orders driven through frontend, backend and API without duplicating the code.
Magnus von Koeller
When a user successfully uses a credit card to pay for an order, that card becomes the default credit card for that user. On future orders, we automatically add that default card as a payment when the order reaches the payment step.
Magnus von Koeller
Provided hooks for extensions to seamlessly integrate with the order population workflow. Extensions make use of the convention of passing parameters during the ‘add to cart’ action https://github.com/spree/spree/blob/master/core/app/models/spree/order_populator.rb#L12 with a prefix like [:options][:voucher_attributes] (in the case of the spree_vouchers extension). The extension then provides some methods named according to what was passed in like:
to determine if these possible line item customizations affect the line item equality condition and
to adjust a line item’s price if necessary.
https://github.com/spree/spree/blob/master/core/app/models/spree/order_contents.rb#L70 shows how we expect inbound parameters (such as the voucher_attributes) to be saved in a nested_attributes fashion.
Rename *_filter callbacks to *_action callbacks.
Move some modules to model’s concerns directory. We move modules Spree::Core::AdjustmentSource, Spree::Core::CalculatedAdjustments, Spree::Core::UserAddress and Spree::Core::UserPaymentSource. Fixes #5264.
Enable default html email templates with Zurb Ink, and PreMailer for Rails.
Ben Morgan & Jeff Dutil