From b2ee01524a2cc51fb48b8f76cb04ba75697a3b6c Mon Sep 17 00:00:00 2001 From: Matt Brailsford Date: Mon, 21 Jul 2025 08:51:07 +0100 Subject: [PATCH 1/8] Updated product adapter docs --- .../key-concepts/product-adapters.md | 15 +++++++------ .../key-concepts/product-adapters.md | 21 +++++++++---------- .../key-concepts/product-adapters.md | 21 +++++++++---------- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/13/umbraco-commerce/key-concepts/product-adapters.md b/13/umbraco-commerce/key-concepts/product-adapters.md index 2b61f090b0b..77dd2e318d6 100644 --- a/13/umbraco-commerce/key-concepts/product-adapters.md +++ b/13/umbraco-commerce/key-concepts/product-adapters.md @@ -13,13 +13,8 @@ What this means for developers is that Product Adapters allow you to hook in alt An example of a Product Adapter would look something like this: ```csharp -public class MyCustomProductAdapter : IProductAdapter +public class MyCustomProductAdapter : ProductAdapterBase { - public IProductSnapshot GetProductSnapshot(string productReference, string languageIsoCode) - { - // Lookup a product by productReference and convert to IProductSnapshot - } - public IProductSnapshot GetProductSnapshot(string productReference, string productVariantReference, string languageIsoCode) { // Lookup a product by productVariantReference and convert to IProductSnapshot @@ -33,9 +28,9 @@ public class MyCustomProductAdapter : IProductAdapter ``` -All Product Adapters implement the `IProductAdapter` interface which requires three method implementations: +All Product Adapters implement the `ProductAdapterBase` base class which requires two method implementations: -* Two `GetProductSnapshot` methods that retrieve a Product Snapshot for either a product or product variant by reference parameters. +* A `GetProductSnapshot` methods that retrieve a Product Snapshot for either a product or product variant by reference parameters. * A `TryGetProductReference` method which retrieves a product/variant reference for a product that belongs to a given `storeId` and has the given `sku`. A Product Snapshot consists of the following properties in order to present a Product to Umbraco Commerce in a standard way. @@ -170,6 +165,10 @@ public interface IProductVariantSnapshot typeProduct Adapters are [registered via the IUmbracoCommerceBuilder](umbraco-commerce-builder.md) interface using the `AddUnique()` method on the `Services` property. The `TReplacementAdapter` parameter is the type of our custom Product Adapter implementation. +{% hint style="info" %} +It is important that you register your product adapter via the `IProductAdapter` interface rather than the `ProductAdapterBase` class. If the `IProductAdapter` displays an obsoletion warning, please ignore this. It is used to promote the use of the `ProductAdapterBase` base class. +{% endhint %} + ```csharp public static class UmbracoCommerceUmbracoBuilderExtensions { diff --git a/15/umbraco-commerce/key-concepts/product-adapters.md b/15/umbraco-commerce/key-concepts/product-adapters.md index ad49caef44f..fc24a99230f 100644 --- a/15/umbraco-commerce/key-concepts/product-adapters.md +++ b/15/umbraco-commerce/key-concepts/product-adapters.md @@ -13,19 +13,14 @@ What this means for developers is that Product Adapters allow you to hook in alt An example of a Product Adapter would look something like this: ```csharp -public class MyCustomProductAdapter : IProductAdapter +public class MyCustomProductAdapter : ProductAdapterBase { - public Task GetProductSnapshotAsync(string productReference, string languageIsoCode) - { - // Lookup a product by productReference and convert to IProductSnapshot - } - - public Task GetProductSnapshotAsync(string productReference, string productVariantReference, string languageIsoCode) + public override Task GetProductSnapshotAsync(string productReference, string productVariantReference, string languageIsoCode) { // Lookup a product by productVariantReference and convert to IProductSnapshot } - Task> TryGetProductReferenceAsync(Guid storeId, string sku) + public override Task> TryGetProductReferenceAsync(Guid storeId, string sku) { // Try lookup a product / variant reference by store + sku } @@ -33,9 +28,9 @@ public class MyCustomProductAdapter : IProductAdapter ``` -All Product Adapters implement the `IProductAdapter` interface which requires three method implementations: +All Product Adapters implement the `ProductAdapterBase` base class which requires two method implementations: -* Two `GetProductSnapshotAsync` methods that retrieve a Product Snapshot for either a product or product variant by reference parameters. +* A `GetProductSnapshotAsync` methods that retrieve a Product Snapshot for either a product or product variant by reference parameters. * A `TryGetProductReferenceAsync` method which retrieves a product/variant reference for a product that belongs to a given `storeId` and has the given `sku`. A Product Snapshot consists of the following properties in order to present a Product to Umbraco Commerce in a standard way. @@ -168,7 +163,11 @@ public interface IProductVariantSnapshot ## Registering a Product Adapter -typeProduct Adapters are [registered via the IUmbracoCommerceBuilder](umbraco-commerce-builder.md) interface using the `AddUnique()` method on the `Services` property. The `TReplacementAdapter` parameter is the type of our custom Product Adapter implementation. +Product Adapters are [registered via the IUmbracoCommerceBuilder](umbraco-commerce-builder.md) interface using the `AddUnique()` method on the `Services` property. The `TReplacementAdapter` parameter is the type of our custom Product Adapter implementation. + +{% hint style="info" %} +It is important that you register your product adapter via the `IProductAdapter` interface rather than the `ProductAdapterBase` class. If the `IProductAdapter` displays an obsoletion warning, please ignore this. It is used to promote the use of the `ProductAdapterBase` base class. +{% endhint %} ```csharp public static class UmbracoCommerceUmbracoBuilderExtensions diff --git a/16/umbraco-commerce/key-concepts/product-adapters.md b/16/umbraco-commerce/key-concepts/product-adapters.md index ad49caef44f..fc24a99230f 100644 --- a/16/umbraco-commerce/key-concepts/product-adapters.md +++ b/16/umbraco-commerce/key-concepts/product-adapters.md @@ -13,19 +13,14 @@ What this means for developers is that Product Adapters allow you to hook in alt An example of a Product Adapter would look something like this: ```csharp -public class MyCustomProductAdapter : IProductAdapter +public class MyCustomProductAdapter : ProductAdapterBase { - public Task GetProductSnapshotAsync(string productReference, string languageIsoCode) - { - // Lookup a product by productReference and convert to IProductSnapshot - } - - public Task GetProductSnapshotAsync(string productReference, string productVariantReference, string languageIsoCode) + public override Task GetProductSnapshotAsync(string productReference, string productVariantReference, string languageIsoCode) { // Lookup a product by productVariantReference and convert to IProductSnapshot } - Task> TryGetProductReferenceAsync(Guid storeId, string sku) + public override Task> TryGetProductReferenceAsync(Guid storeId, string sku) { // Try lookup a product / variant reference by store + sku } @@ -33,9 +28,9 @@ public class MyCustomProductAdapter : IProductAdapter ``` -All Product Adapters implement the `IProductAdapter` interface which requires three method implementations: +All Product Adapters implement the `ProductAdapterBase` base class which requires two method implementations: -* Two `GetProductSnapshotAsync` methods that retrieve a Product Snapshot for either a product or product variant by reference parameters. +* A `GetProductSnapshotAsync` methods that retrieve a Product Snapshot for either a product or product variant by reference parameters. * A `TryGetProductReferenceAsync` method which retrieves a product/variant reference for a product that belongs to a given `storeId` and has the given `sku`. A Product Snapshot consists of the following properties in order to present a Product to Umbraco Commerce in a standard way. @@ -168,7 +163,11 @@ public interface IProductVariantSnapshot ## Registering a Product Adapter -typeProduct Adapters are [registered via the IUmbracoCommerceBuilder](umbraco-commerce-builder.md) interface using the `AddUnique()` method on the `Services` property. The `TReplacementAdapter` parameter is the type of our custom Product Adapter implementation. +Product Adapters are [registered via the IUmbracoCommerceBuilder](umbraco-commerce-builder.md) interface using the `AddUnique()` method on the `Services` property. The `TReplacementAdapter` parameter is the type of our custom Product Adapter implementation. + +{% hint style="info" %} +It is important that you register your product adapter via the `IProductAdapter` interface rather than the `ProductAdapterBase` class. If the `IProductAdapter` displays an obsoletion warning, please ignore this. It is used to promote the use of the `ProductAdapterBase` base class. +{% endhint %} ```csharp public static class UmbracoCommerceUmbracoBuilderExtensions From 4277faeb3aa02b211243707d0052febd6185e575 Mon Sep 17 00:00:00 2001 From: Esha Noronha <82437098+eshanrnh@users.noreply.github.com> Date: Mon, 21 Jul 2025 10:33:48 +0200 Subject: [PATCH 2/8] Update 13/umbraco-commerce/key-concepts/product-adapters.md --- 13/umbraco-commerce/key-concepts/product-adapters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/13/umbraco-commerce/key-concepts/product-adapters.md b/13/umbraco-commerce/key-concepts/product-adapters.md index 77dd2e318d6..5cb00cc071a 100644 --- a/13/umbraco-commerce/key-concepts/product-adapters.md +++ b/13/umbraco-commerce/key-concepts/product-adapters.md @@ -30,7 +30,7 @@ public class MyCustomProductAdapter : ProductAdapterBase All Product Adapters implement the `ProductAdapterBase` base class which requires two method implementations: -* A `GetProductSnapshot` methods that retrieve a Product Snapshot for either a product or product variant by reference parameters. +* A `GetProductSnapshot` method that retrieves a Product Snapshot for either a product or a product variant by reference parameters. * A `TryGetProductReference` method which retrieves a product/variant reference for a product that belongs to a given `storeId` and has the given `sku`. A Product Snapshot consists of the following properties in order to present a Product to Umbraco Commerce in a standard way. From f17dfc342cd41f83073ac19b50b4b0cc7a108b1b Mon Sep 17 00:00:00 2001 From: Esha Noronha <82437098+eshanrnh@users.noreply.github.com> Date: Mon, 21 Jul 2025 10:33:56 +0200 Subject: [PATCH 3/8] Update 13/umbraco-commerce/key-concepts/product-adapters.md --- 13/umbraco-commerce/key-concepts/product-adapters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/13/umbraco-commerce/key-concepts/product-adapters.md b/13/umbraco-commerce/key-concepts/product-adapters.md index 5cb00cc071a..13e0ac99d00 100644 --- a/13/umbraco-commerce/key-concepts/product-adapters.md +++ b/13/umbraco-commerce/key-concepts/product-adapters.md @@ -166,7 +166,7 @@ public interface IProductVariantSnapshot typeProduct Adapters are [registered via the IUmbracoCommerceBuilder](umbraco-commerce-builder.md) interface using the `AddUnique()` method on the `Services` property. The `TReplacementAdapter` parameter is the type of our custom Product Adapter implementation. {% hint style="info" %} -It is important that you register your product adapter via the `IProductAdapter` interface rather than the `ProductAdapterBase` class. If the `IProductAdapter` displays an obsoletion warning, please ignore this. It is used to promote the use of the `ProductAdapterBase` base class. +It is important that you register your product adapter via the `IProductAdapter` interface rather than the `ProductAdapterBase` class. If the `IProductAdapter` displays an obsolete warning, kindly ignore this. It is used to promote the use of the `ProductAdapterBase` base class. {% endhint %} ```csharp From 2a4860c4cbfd2c9d0016b4a0bbbeefee7df66b50 Mon Sep 17 00:00:00 2001 From: Esha Noronha <82437098+eshanrnh@users.noreply.github.com> Date: Mon, 21 Jul 2025 10:34:03 +0200 Subject: [PATCH 4/8] Update 15/umbraco-commerce/key-concepts/product-adapters.md --- 15/umbraco-commerce/key-concepts/product-adapters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15/umbraco-commerce/key-concepts/product-adapters.md b/15/umbraco-commerce/key-concepts/product-adapters.md index fc24a99230f..ebf370266e2 100644 --- a/15/umbraco-commerce/key-concepts/product-adapters.md +++ b/15/umbraco-commerce/key-concepts/product-adapters.md @@ -30,7 +30,7 @@ public class MyCustomProductAdapter : ProductAdapterBase All Product Adapters implement the `ProductAdapterBase` base class which requires two method implementations: -* A `GetProductSnapshotAsync` methods that retrieve a Product Snapshot for either a product or product variant by reference parameters. +* A `GetProductSnapshotAsync` method that retrieves a Product Snapshot for either a product or a product variant by reference parameters. * A `TryGetProductReferenceAsync` method which retrieves a product/variant reference for a product that belongs to a given `storeId` and has the given `sku`. A Product Snapshot consists of the following properties in order to present a Product to Umbraco Commerce in a standard way. From 1882961a89566ad463a51e5ab00c73aeabe9f9c9 Mon Sep 17 00:00:00 2001 From: Esha Noronha <82437098+eshanrnh@users.noreply.github.com> Date: Mon, 21 Jul 2025 10:34:11 +0200 Subject: [PATCH 5/8] Update 15/umbraco-commerce/key-concepts/product-adapters.md --- 15/umbraco-commerce/key-concepts/product-adapters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15/umbraco-commerce/key-concepts/product-adapters.md b/15/umbraco-commerce/key-concepts/product-adapters.md index ebf370266e2..e0cb235d09e 100644 --- a/15/umbraco-commerce/key-concepts/product-adapters.md +++ b/15/umbraco-commerce/key-concepts/product-adapters.md @@ -166,7 +166,7 @@ public interface IProductVariantSnapshot Product Adapters are [registered via the IUmbracoCommerceBuilder](umbraco-commerce-builder.md) interface using the `AddUnique()` method on the `Services` property. The `TReplacementAdapter` parameter is the type of our custom Product Adapter implementation. {% hint style="info" %} -It is important that you register your product adapter via the `IProductAdapter` interface rather than the `ProductAdapterBase` class. If the `IProductAdapter` displays an obsoletion warning, please ignore this. It is used to promote the use of the `ProductAdapterBase` base class. +It is important that you register your product adapter via the `IProductAdapter` interface rather than the `ProductAdapterBase` class. If the `IProductAdapter` displays an obsolete warning, kindly ignore this. It is used to promote the use of the `ProductAdapterBase` base class. {% endhint %} ```csharp From 7be9197e2ec9b5f6934c1a8b363c0ed4ff335b5f Mon Sep 17 00:00:00 2001 From: Esha Noronha <82437098+eshanrnh@users.noreply.github.com> Date: Mon, 21 Jul 2025 10:34:19 +0200 Subject: [PATCH 6/8] Update 16/umbraco-commerce/key-concepts/product-adapters.md --- 16/umbraco-commerce/key-concepts/product-adapters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/16/umbraco-commerce/key-concepts/product-adapters.md b/16/umbraco-commerce/key-concepts/product-adapters.md index fc24a99230f..ebf370266e2 100644 --- a/16/umbraco-commerce/key-concepts/product-adapters.md +++ b/16/umbraco-commerce/key-concepts/product-adapters.md @@ -30,7 +30,7 @@ public class MyCustomProductAdapter : ProductAdapterBase All Product Adapters implement the `ProductAdapterBase` base class which requires two method implementations: -* A `GetProductSnapshotAsync` methods that retrieve a Product Snapshot for either a product or product variant by reference parameters. +* A `GetProductSnapshotAsync` method that retrieves a Product Snapshot for either a product or a product variant by reference parameters. * A `TryGetProductReferenceAsync` method which retrieves a product/variant reference for a product that belongs to a given `storeId` and has the given `sku`. A Product Snapshot consists of the following properties in order to present a Product to Umbraco Commerce in a standard way. From b36c084f15d990bc34e29eaf01f530208e9eca95 Mon Sep 17 00:00:00 2001 From: Esha Noronha <82437098+eshanrnh@users.noreply.github.com> Date: Mon, 21 Jul 2025 10:34:26 +0200 Subject: [PATCH 7/8] Update 16/umbraco-commerce/key-concepts/product-adapters.md --- 16/umbraco-commerce/key-concepts/product-adapters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/16/umbraco-commerce/key-concepts/product-adapters.md b/16/umbraco-commerce/key-concepts/product-adapters.md index ebf370266e2..e0cb235d09e 100644 --- a/16/umbraco-commerce/key-concepts/product-adapters.md +++ b/16/umbraco-commerce/key-concepts/product-adapters.md @@ -166,7 +166,7 @@ public interface IProductVariantSnapshot Product Adapters are [registered via the IUmbracoCommerceBuilder](umbraco-commerce-builder.md) interface using the `AddUnique()` method on the `Services` property. The `TReplacementAdapter` parameter is the type of our custom Product Adapter implementation. {% hint style="info" %} -It is important that you register your product adapter via the `IProductAdapter` interface rather than the `ProductAdapterBase` class. If the `IProductAdapter` displays an obsoletion warning, please ignore this. It is used to promote the use of the `ProductAdapterBase` base class. +It is important that you register your product adapter via the `IProductAdapter` interface rather than the `ProductAdapterBase` class. If the `IProductAdapter` displays an obsolete warning, kindly ignore this. It is used to promote the use of the `ProductAdapterBase` base class. {% endhint %} ```csharp From f08432f346f678bc5cb8ffca3c9edef73a764c7b Mon Sep 17 00:00:00 2001 From: Esha Noronha <82437098+eshanrnh@users.noreply.github.com> Date: Mon, 21 Jul 2025 10:34:34 +0200 Subject: [PATCH 8/8] Update 13/umbraco-commerce/key-concepts/product-adapters.md --- 13/umbraco-commerce/key-concepts/product-adapters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/13/umbraco-commerce/key-concepts/product-adapters.md b/13/umbraco-commerce/key-concepts/product-adapters.md index 13e0ac99d00..0aae0cf546c 100644 --- a/13/umbraco-commerce/key-concepts/product-adapters.md +++ b/13/umbraco-commerce/key-concepts/product-adapters.md @@ -163,7 +163,7 @@ public interface IProductVariantSnapshot ## Registering a Product Adapter -typeProduct Adapters are [registered via the IUmbracoCommerceBuilder](umbraco-commerce-builder.md) interface using the `AddUnique()` method on the `Services` property. The `TReplacementAdapter` parameter is the type of our custom Product Adapter implementation. +Product Adapters are [registered via the IUmbracoCommerceBuilder](umbraco-commerce-builder.md) interface using the `AddUnique()` method on the `Services` property. The `TReplacementAdapter` parameter is the type of our custom Product Adapter implementation. {% hint style="info" %} It is important that you register your product adapter via the `IProductAdapter` interface rather than the `ProductAdapterBase` class. If the `IProductAdapter` displays an obsolete warning, kindly ignore this. It is used to promote the use of the `ProductAdapterBase` base class.