|
| 1 | +--- |
| 2 | +sidebar_position: 1 |
| 3 | +--- |
| 4 | + |
| 5 | +import PRLink from '@site/src/theme/PRLink'; |
| 6 | + |
| 7 | +# Solidus v3.3 (2022-01-15) |
| 8 | + |
| 9 | +New year, new Solidus release! This time, we acknowledge our [new policy around Ruby & Rails support](https://solidus.io/release_policy/). It also comes with new features, bug fixes, as well as some deprecations that will be removed in the next major release. Take the time to upgrade. We've committed with the community to release more often, so keeping up to date will help you when Solidus v4.0 is out, which will happen sooner than later. |
| 10 | + |
| 11 | +Before getting hands-on, please review our generic [upgrade guides](/getting-started/upgrading-solidus.mdx). You can also check the complete [Changelog](https://github.com/solidusio/solidus/blob/v3.3/CHANGELOG.md) in our repository. |
| 12 | + |
| 13 | +## <PRLink description="Added support for Ruby v3.2" number="4817" /> |
| 14 | + |
| 15 | +Solidus v3.3 comes with support for the recently released v3.2 of Ruby. You can safely upgrade to it without Solidus getting in your way. |
| 16 | + |
| 17 | +## <PRLink description="Removed support for Ruby v2.5" number="4845" /> |
| 18 | + |
| 19 | +With v3.3, Solidus performs a long-due cleanup of its codebase, removing support for EOL's Ruby versions v2.5 & v2.6. If you're on Solidus v3.2 and you want to upgrade to v3.3: |
| 20 | + |
| 21 | +- Update your Solidus v3.2 store to Ruby v2.6. |
| 22 | +- Update your Solidus v3.2 store to Ruby v2.7. |
| 23 | +- Update your Solidus v3.2 store to v3.3. |
| 24 | + |
| 25 | +## <PRLink description="Removed support for Ruby v2.6" number="4848" /> |
| 26 | + |
| 27 | +Solidus v3.3 no longer supports Ruby v2.6, which reached the EOL status. You'll need to: |
| 28 | + |
| 29 | +- Update your Solidus v3.2 store to Ruby v2.7. |
| 30 | +- Update your Solidus v3.2 store to v3.3. |
| 31 | + |
| 32 | +## <PRLink description="Removed support for Rails v5.2" number="4850" /> |
| 33 | + |
| 34 | +Rails v5.2 (EOL) support has been removed from Solidus v3.3: |
| 35 | + |
| 36 | +- Update your Solidus v3.2 store to Rails v6.0. |
| 37 | +- Update your Solidus v3.2 store to v3.3. |
| 38 | + |
| 39 | +## <PRLink description="Support for the new Colorado delivery fee" number="4491" /> |
| 40 | + |
| 41 | +We've updated our taxation system to support the new [Colorado retail delivery fee](https://tax.colorado.gov/retail-delivery-fee): |
| 42 | + |
| 43 | +- Create a new `Spree::Zone` for the state of Colorado. |
| 44 | +- Create a new `Spree::TaxRate` within that zone, with: |
| 45 | + - The new `Spree::Calculator::FlatFee` as its base calculator. |
| 46 | + - An amount of 0.27$. |
| 47 | + - The new `Spree::TaxRate#level` enum to `:order` |
| 48 | + |
| 49 | +We also provide a task to help with the process (it'll add the new tax to the default category if it exists): |
| 50 | + |
| 51 | +```bash |
| 52 | +bundle exec rake taxes:colorado_delivery_fee |
| 53 | +``` |
| 54 | + |
| 55 | +## <PRLink description="Version upgraded for packaged underscore.js" number="4660" /> |
| 56 | + |
| 57 | +We've upgraded the packaged version of [underscore.js](https://underscorejs.org/) from v1.8.3 to v1.13.6. In case you were using it, check compatibility. |
| 58 | + |
| 59 | +## <PRLink description="Deprecated #mails_from preference" number="4712" /> |
| 60 | + |
| 61 | +We've deprecated the `#mails_from` preference, as it wasn't used in the Solidus codebase anymore. Make sure you aren't using it for anything else. Otherwise, the expected way to handle the default `From:` field for transactional emails is the `Spree::Store#mail_from_address` attribute. |
| 62 | + |
| 63 | +## <PRLink description="Configurable promotion adjuster" number="4460" /> |
| 64 | + |
| 65 | +You can now change what the default promotion adjuster does. Configure the `Spree::Config.promotion_adjuster_class` preference with a class that takes the order on initialization and responds to the `#call` method. |
| 66 | + |
| 67 | +```ruby title="config/initializers/spree.rb" |
| 68 | +Spree.config do |config| |
| 69 | + # ... |
| 70 | + config.promotion_adjuster_class = 'MyStore::PromotionAdjuster' |
| 71 | +end |
| 72 | +``` |
| 73 | + |
| 74 | +```ruby title="app/models/my_store/promotion_adjuster.rb" |
| 75 | +module MyStore |
| 76 | + class PromotionAdjuster |
| 77 | + def initialize(order) |
| 78 | + @order = order |
| 79 | + end |
| 80 | + |
| 81 | + def call |
| 82 | + # ... |
| 83 | + end |
| 84 | + end |
| 85 | +end |
| 86 | +``` |
| 87 | + |
| 88 | +## <PRLink description="Configurable algorithm to prioritize store credits" number="4677" /> |
| 89 | + |
| 90 | +Before v3.3, store credits were always sorted by the priority of their type. Now you can change that behavior by configuring the `Spree::Config.store_credit_prioritizer_class` preference with a class that takes the store credits and the order on initialization and responds to the `#call` method. |
| 91 | + |
| 92 | +```ruby title="config/initializers/spree.rb" |
| 93 | +Spree.config do |config| |
| 94 | + # ... |
| 95 | + config.store_credit_prioritizer_class = 'MyStore::StoreCreditPrioritizer' |
| 96 | +end |
| 97 | +``` |
| 98 | + |
| 99 | +```ruby title="app/models/my_store/store_credit_prioritizer.rb" |
| 100 | +module MyStore |
| 101 | + class StoreCreditPrioritizer |
| 102 | + def initialize(store_credits, order) |
| 103 | + @store_credits = store_credits |
| 104 | + @order = order |
| 105 | + end |
| 106 | + |
| 107 | + def call |
| 108 | + # ... |
| 109 | + end |
| 110 | + end |
| 111 | +end |
| 112 | +``` |
| 113 | + |
| 114 | +## <PRLink description="Allow shipping category on variants" number="4739" /> |
| 115 | + |
| 116 | +It was already possible for a variant to have a different tax category than its product. Now, that's also true for the shipping category. |
| 117 | + |
| 118 | +## <PRLink description="Default implementation for PaymentMethod#try_void" number="4843" /> |
| 119 | + |
| 120 | +When adding a new payment integration, it was required to implement the `PaymentMethod#try_void` method. However, it turned out that the logic was always very similar. We now provide a default implementation that would be enough in most situations. |
| 121 | + |
| 122 | +## <PRLink description="Variant and product autocomplete functions flexibility with Ransack" number="4767" /> |
| 123 | + |
| 124 | +It's now possible to customize the autocompletion for variants and products on the backend via a callback returning a Ransack query. E.x.: |
| 125 | + |
| 126 | +```javascript |
| 127 | +$('#product-dropdown').productAutocomplete({ |
| 128 | + multiple: false, |
| 129 | + searchCallback: (searchString) => ({ |
| 130 | + q: { |
| 131 | + name_cont: searchString, |
| 132 | + available_on_not_null: true |
| 133 | + }) |
| 134 | + } |
| 135 | +}) |
| 136 | +``` |
0 commit comments