Skip to content

Umbraco Commerce v15.1.0-rc release notes #6859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 10, 2025
3 changes: 3 additions & 0 deletions 15/umbraco-commerce/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* [Umbraco Commerce Documentation](README.md)
* [Release Notes](release-notes/README.md)
* [v15.1.0-Rc](release-notes/v15.1.0-rc.md)
* [v15.0.0-Rc](release-notes/v15.0.0-rc.md)

## Commerce Products
Expand Down Expand Up @@ -36,6 +37,7 @@
* [Update Cart](how-to-guides/update-cart.md)
* [Delete item from Cart](how-to-guides/delete-item.md)
* [Customizing Templates](how-to-guides/customizing-templates.md)
* [Configuring Store Cleanup](how-to-guides/configuring-cart-cleanup.md)

## Key Concepts

Expand Down Expand Up @@ -71,6 +73,7 @@
* [UI Extensions](key-concepts/ui-extensions/README.md)
* [Analytics Widgets](key-concepts/ui-extensions/analytics-widgets.md)
* [Entity Quick Actions](key-concepts/ui-extensions/entity-quick-actions.md)
* [Order Line Actions](key-concepts/ui-extensions/order-line-actions.md)
* [Order Properties](key-concepts/ui-extensions/order-properties.md)
* [Order Collection Properties](key-concepts/ui-extensions/order-collection-properties.md)
* [Order Line Properties](key-concepts/ui-extensions/order-line-properties.md)
Expand Down
55 changes: 55 additions & 0 deletions 15/umbraco-commerce/how-to-guides/configuring-cart-cleanup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
description: Learn how to configure a cart cleanup routine.
---

# Configuring Cart Cleanup

{% hint style="info" %}
Available from Umbraco Commerce 15.1.0
{% endhint %}

By default Umbraco Commerce will keep all created carts indefinately. Over time this can become an issue. To assist with this is it possible to configure a cart cleanup routine to delete carts older than a pre-configured time interval.


This service can be enabled and configured in the `appSettings.json`

```json
{
"Umbraco" : {
"Commerce": {
"CartCleanupPolicy": {
"EnableCleanup": true,
"KeepCartsForDays": 800,
// Optional settings
"FirstRunTime": "* 4 * * *",
"Period": "1.00:00:00",
"PerStorePolicies": {
"{STORE_ALIAS}": {
"KeepCartsForDays": 800,
}
}
}
}
}
}
```

The configuration supports the followin keys.

| Key | Description |
| -- | -- |
| `EnableCleanup` | Enables or disabled the cart cleanup service. `false` by default. |
| `KeepCartsForDays` | The number of days to keep carts after the carts last modification date. |
| `FirstRunTime` | The time to first run the scheduled cleanup task, in crontab format. If empty, runs imediately on app startup. |
| `Period` | How often to run the task, in timespan format. Defaults to every 24 hours. |
| `PerStorePolicies` | Define store specific policies. |
| `PerStorePolicies.{STORE_ALAIS}.KeepCartsForDays` | The number of days to keep carts after the carts last modification date for the given store. |

## Cart Conversion Rates Widget

When enabling the cart cleanup service, it's important to know that this can affect the cart conversion rates widget in the analytics section. If the widget is configured to show a time period that exceeds the cleanup policies time frame then a warning will be displayed.

![Cart Conversion Rate date range exceeds the cart cleanup policy configuration warning](../media/v14/cart-conversion-rates-warning.png)



Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
description: Order Line Actions UI Extension for Umbraco Commerce
---

# Order Line Actions

{% hint style="info" %}
Available from Umbraco Commerce 15.1.0
{% endhint %}

Order Line Actions allow you to display buttons against each order line of a cart/order enabling you to perform custom actions per order line.


![Custom Order Line Action](../../media/v14/order-line-action.png)

## Registering an Order Line Action

```typescript
import { UcManifestOrderLineAction } from "@umbraco-commerce/backoffice";

export const manifests : UcManifestOrderLineAction[] = [
{
type: 'ucOrderLineAction',
kind: 'default',
alias: 'My.OrderLineAction.MyOrderLineAction',
name: 'My Order Line Action',
weight: 300,
forEntityTypes: [ 'uc:cart', 'uc:order' ],
api: () => import('./my-order-line-action.api.js'),
meta: {
label: "#orderLineActions_myOrderLineAction",
icon: 'icon-star'
}
}
];

extensionRegistry.register(manifests);
```

Each entry must have a type of `ucOrderLineAction` along with a unique `alias` and `name`. Unless you wish to override the button, the `kind` key should be set to `default`. An `api` key that imports the implementation of the `UcOrderLineActionApi` interface, should be defined.


A `meta` entry provides configuration options for order line actions:

| Name | Description |
| -- | -- |
| `label` | A label for this action (supports the `#` prefix localization string syntax) |
| `icon` | In icon to display for the action |

## The Order Line Action API

In order to define the logic to perform when an order line action button is clicked, you'll need to implement the `UcOrderLineActionApi` interface. This interface is defined as

```typescript
export interface UcOrderLineActionApi extends UmbApi {
manifest: UcManifestOrderLineAction;
storeId: string;
orderId: string;
orderLineId: string;
execute(): Promise<void>;
}
```

This provides order line action implementations with access to the defined `manifest` and contextual information via the `storeId`, `orderId` and `orderLineId` properties. It expects the implementation of an `execute` method to act.


An example implementation would be

```typescript
// my-order-line-action.api.js

import { UcOrderLineActionApi, UcManifestOrderLineAction } from "@umbraco-commerce/backoffice";
import { UmbControllerBase } from "@umbraco-cms/backoffice/class-api";

export default class MyOrderLineActionApi extends UmbControllerBase implements UcOrderLineActionApi {
manifest!: UcManifestOrderLineAction;
storeId!: string;
orderId!: string;
orderLineId!: string;
async execute() {
console.log(`You clicked ${this.manifest!.meta.label} for order line ${this.orderLineId}`);
return Promise.resolve();
}
}
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions 15/umbraco-commerce/release-notes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ If you are upgrading to a new major version, check the breaking changes in the [

This section contains the release notes for Umbraco Commerce 14 including all changes for this version.

#### 15.1.0-rc1 (7th Feb 2025)

Read the [v15.1.0-rc release post](./v15.1.0-rc.md) for further background on this release.

* Added cart cleanup service
* Added order line actions UI extension point

#### 15.0.1 (5th Feb 2025)

* Fixed `TranslatedValue` erroring if the language key was `null`, instead of falling back to the default value.
Expand Down
45 changes: 45 additions & 0 deletions 15/umbraco-commerce/release-notes/v15.1.0-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
description: Umbraco Commerce v15.1.0-RC release notes.
---

# v15.1.0-RC

## Key Takeaways

* [Cart Cleanup Service](v15.1.0-rc.md#cart-cleanup-service).
* [Order Line Actions](v15.1.0-rc.md#order-line-actions)

## Cart Cleanup Service

The cart cleanup service is a new background service that periodically cleans up old abandoned carts. This service is off by default, but can be enabled via app settings.

```json
{
"Umbraco" : {
"Commerce": {
"CartCleanupPolicy": {
"EnableCleanup": true,
"KeepCartsForDays": 800
}
}
}
}
```

See the [Configuring Cart Cleanup guide](../how-to-guides/configuring-cart-cleanup.md) for more details.

## Order Line Actions

Order line actions are a new UI extension point that lets you register custom buttons to display against each order line of a cart/order.


![Custom Order Line Action](../media/v14/order-line-action.png)

See the [Order Line Actions article](../key-concepts/ui-extensions/order-line-actions.md) for more details.


## What to Test and How to Give Feedback

We welcome any feedback on installation or upgrade issues, as well as any bugs found in the sections mentioned above.

Issues can be raised on the Umbraco Commerce issue tracker at [https://github.com/umbraco/Umbraco.Commerce.Issues/issues](https://github.com/umbraco/Umbraco.Commerce.Issues/issues).