Skip to content

Commit

Permalink
Add docs on the Liquid filter changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahelsaig committed Jul 26, 2024
1 parent b5b8e76 commit e713c5f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions docs/releases/3.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,21 @@ Prior to making the leap to Orchard Core Commerce 3.0.0, please read and follow

## Breaking Changes

### Drop `Newtonsoft.Json` Support
### Dropped `Newtonsoft.Json` Support

The most important breaking change in OC 2.0 is the end of support for [Newtonsoft Json.NET](https://www.newtonsoft.com/json) and the switch to the [System.Text.Json](https://www.nuget.org/packages/System.Text.Json) (STJ) library. For OCC, this means the break
The most important breaking change in OC 2.0 is the end of support for [Newtonsoft Json.NET](https://www.newtonsoft.com/json) and the switch to the [System.Text.Json](https://www.nuget.org/packages/System.Text.Json) (STJ) library. For OCC, all Newtonsoft converters are removed, STJ converters were written or updated as necessary. Any models and interfaces that uses `JToken` or `JObject` (such as `OrderPart.AdditionalData` and `IUserService.AlterUserSettingAsync()`) now use `JsonNode` and `JsonObject` respectively.

### Replace `IPayment` with `Payment` everywhere
### Replaced `IPayment` with `Payment` Everywhere

We've dropped the [`IPayment`](https://github.com/OrchardCMS/OrchardCore.Commerce/blob/34ae00470e954459f19f688c9bfc51d196c386ca/src/Libraries/OrchardCore.Commerce.Abstractions/Abstractions/IPayment.cs) interface, now services and models use `Payment` directly, which was also moved into the `OrchardCore.Commerce.Abstractions` library. Migrating to STJ meant that to retain the polymorphic deserialization support for models using `IPayment` would've taken on some additional complexity, while we already found the separate interface unnecessary.
If you have a custom payment processor integration, you will have to update it to use `Payment`.

Update using references to `OrchardCore.Commerce.Abstractions.Models`. If you have a custom payment processor integration, update it to use `Payment`.

### Liquid Filters

The `order_line_item_view_models_and_tax_rates` Liquid filter has been removed. A new `order_part_to_order_summary` filter has been added instead, which can be treated as a drop-in replacement. In has additional `Amount` type properties `UnitTax`, `SubTotal`, `TaxTotal` and `Total`. These contain the calculated and appropriately rounded values.

The new `amount_to_string` filter processes the input object as `Amount` (like the `amount` filter) and correctly formats it just like the `Amount.ToString()` override in C#. You can use `amount_to_string: dot: ","` to make it display comma as the decimal separator when it would use dot. Unlike `amount`, you can also use this filter on a number with the `currency: "three-letter-code""` argument (e.g. `{{ value | amount_to_string: currency: "EUR" }}`). This will display any numeric value as the given currency.

## Change Logs

Expand Down

0 comments on commit e713c5f

Please sign in to comment.