---
title: "Catalog service methods"
slug: "catalog-service-methods"
abstract: "Overview of the catalog service provider and methods for interacting with catalog search data."
---
# Catalog service methods

Service providers are wrapper objects designed to make it easier to interact with Connect pipelines. The providers implement no logic other than calling Connect pipelines. All of the business logic is implemented in the pipeline processors.

The Catalog service provider contains the following methods for interacting with catalog search data.

<details>
<summary><h2>ProductSorting method</h2></summary>

| **Name:** | **ProductSorting** |
| --- | --- |
| **Description:** | A method to let Commerce Connect know when a user has performed a page sort, so that the event can be tracked in xDB.<br><br>Calls the `productSorting` pipeline. |
| **Usage:** | Called from Sitecore when a user performs a sort. |
| **Signature:** | `CatalogResult ProductSorting(ProductSortingRequest request)` |
| **Input:** |  |
|  | **ShopName – string. Mandatory**<br><br>The name of the shop. |
|  | **SortKey** **–****string** **. Mandatory**<br><br>The field that was sorted on in the search. |
|  | **SortDirection** **–****SortDirection** **. Mandatory**<br><br>The direction in which the search was sorted, that is, **Asc** or **Desc****.** |
| **Output:** |  |

Usage example:

```

var provider = (CatalogServiceProvider)Factory.CreateObject("catalogServiceProvider", true);
var request = new ProductSortingRequest("StarterKit", "Price", SortDirection.Ascending);
var result = provider.ProductSorting(request);

```

</details>

<details>
<summary><h2>FacetApplied method</h2></summary>

| **Name:** | **FacetApplied** |
| --- | --- |
| **Description:** | A method to let Commerce Connect know when a user has tried to facet some search information, so that the event can be tracked in xDB.<br><br>Calls the `facetApplied` pipeline. |
| **Usage:** | Called from Sitecore when a user facets on search results. |
| **Signature:** | `CatalogResult FacetApplied(FacetAppliedRequest request)` |
| **Input:** |  |
|  | **ShopName – String. Mandatory**<br><br>The name of the shop. |
|  | **Facet** **-****String** **. Mandatory**<br><br>The facet field that the search was performed on. |
|  | **IsApplied** **–****bool** **. Optional**<br><br>Used to indicate whether or not the facet was applied. |
| **Output:** |  |

Usage example:

```

var provider = (CatalogServiceProvider)Factory.CreateObject("catalogServiceProvider", true);
var request = new FacetAppliedRequest("StarterKit", "Manufacturer", true);
var result = provider.FacetApplied(request);

```

</details>

<details>
<summary><h2>VisitedCategoryPage method</h2></summary>

| **Name:** | **VisitedCategoryPage** |
| --- | --- |
| **Description:** | A method to let Commerce Connect know when a user visits a category page, so that the event can be tracked in xDB.<br><br>Calls the `visitedCategoryPage` pipeline. |
| **Usage:** | Called from Sitecore when a user visits a category page. |
| **Signature:** | `CatalogResult VisitedCategoryPage(VisitedCategoryPageRequest request)` |
| **Input:** |  |
|  | **ShopName – String. Mandatory**<br><br>The name of the shop. |
|  | **CategoryId** **-****string** **. Mandatory**<br><br>The ID of the category the user visited. |
|  | **CategoryName** **– string.****Mandatory**<br><br>The name of the category the user visited. |
| **Output:** |  |

Usage example:

```

var provider = (CatalogServiceProvider)Factory.CreateObject("catalogServiceProvider", true);
var request = new VisitedCategoryPageRequest("StarterKit", "2", "Computers");
var result = provider.VisitedCategoryPage(request);

```

</details>

<details>
<summary><h2>VisitedProductDetailsPage method</h2></summary>

| **Name:** | **VisitedProductStockStatus** |
| --- | --- |
| **Description:** | A method to let Commerce Connect know when a user visits a product details page, so that the event can be tracked in xDB.<br><br>Calls the `visitedProductDetailsPage` pipeline. |
| **Usage:** | Called from Sitecore when a user visits a product details page. |
| **Signature:** | `CatalogResult VisitedProductDetailsPage(VisitedProductDetailsPageRequest request)` |
| **Input:** |  |
|  | **ShopName – string. Mandatory**<br><br>The name of the shop. |
|  | **ProductId** **-****string** **. Mandatory**<br><br>The id of the visited product |
|  | **ProductName** **– string.****Mandatory**<br><br>The name of the visited product. |
|  | **ParentCategoryId** **– string. Mandatory**<br><br>The category of the visited product. |
|  | **ParentCategoryName – string. Mandatory**<br><br>The name of the category of the visited product. |
|  | **Amount – decimal. Optional**<br><br>The price of the visited product. |
|  | **CurrencyCode – decimal. Optional**<br><br>The currency the user viewed the product in. |
| **Output:** |  |

Usage example:

```

var provider = (CatalogServiceProvider)Factory.CreateObject("catalogServiceProvider", true);
var request = new VisitedProductDetailsPageRequest("StarterKit", "23", "Diamond Pave Earrings", "17", "Jewelry");
var result = provider.VisitedProductDetailsPage(request);

```

</details>

<details>
<summary><h2>SearchInitiated method</h2></summary>

| **Name:** | **SearchInitiated** |
| --- | --- |
| **Description:** | A method to let Commerce Connect know when a user performs a keyword search, so that the event can be tracked in xDB.<br><br>Calls the `searchInitiated` pipeline. |
| **Usage:** | Called from Sitecore when a user visits a keyword search. |
| **Signature:** | `CatalogResult SearchInitiated(SearchInitiatedRequest request)` |
| **Input:** |  |
|  | **Shop Name – string. Mandatory**<br><br>The name of the shop for which this relates. |
|  | **SearchTerm** **–****string** **. Mandatory**<br><br>The keywords the user searched for. |
|  | **NumberOfHits** **–****int** **.****Optional**<br><br>The number of results found. |
| **Output:** |  |

Usage example:

```

var provider = (CatalogServiceProvider)Factory.CreateObject("catalogServiceProvider", true);
            var request = new SearchInitiatedRequest("StarterKit", "Diamond Tennis Bracelet", 1 );
            var result = provider.SearchInitiated(request);

```

</details>