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.
ProductSorting method
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. Calls the |
Usage: |
Called from Sitecore when a user performs a sort. |
Signature: |
|
Input: | |
ShopName – string. Mandatory The name of the shop. | |
SortKey – string . Mandatory The field that was sorted on in the search. | |
SortDirection – SortDirection . Mandatory 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);
FacetApplied method
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. Calls the |
Usage: |
Called from Sitecore when a user facets on search results. |
Signature: |
|
Input: | |
ShopName – String. Mandatory The name of the shop. | |
Facet - String . Mandatory The facet field that the search was performed on. | |
IsApplied – bool . Optional 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);
VisitedCategoryPage method
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. Calls the |
Usage: |
Called from Sitecore when a user visits a category page. |
Signature: |
|
Input: | |
ShopName – String. Mandatory The name of the shop. | |
CategoryId - string . Mandatory The ID of the category the user visited. | |
CategoryName – string. Mandatory 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);
VisitedProductDetailsPage method
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. Calls the |
Usage: |
Called from Sitecore when a user visits a product details page. |
Signature: |
|
Input: | |
ShopName – string. Mandatory The name of the shop. | |
ProductId - string . Mandatory The id of the visited product | |
ProductName – string. Mandatory The name of the visited product. | |
ParentCategoryId – string. Mandatory The category of the visited product. | |
ParentCategoryName – string. Mandatory The name of the category of the visited product. | |
Amount – decimal. Optional The price of the visited product. | |
CurrencyCode – decimal. Optional 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);
SearchInitiated method
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. Calls the |
Usage: |
Called from Sitecore when a user visits a keyword search. |
Signature: |
|
Input: | |
Shop Name – string. Mandatory The name of the shop for which this relates. | |
SearchTerm – string . Mandatory The keywords the user searched for. | |
NumberOfHits – int . Optional 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);