This is sample plugin to convert Sitecore Commerce data into Sitecore Discover catalog feeds.
- XC 10.1
- Category Migration
- Sellable Item (Product) Migration
- Locales
- Pricing via price cards
- Sale Pricing (currently a copy of the List Price)
- Store pricing and inventory
There are a few pre-requisite tasks required in Sitecore Discover prior to being able to ingest the feeds generated from XC data. These include:
- Configure feed file names.
- Configure product model and industry vertical.
- Create custom product attributes.
The postman collection can be imported from the solution's /postman
folder. The Create Discover Feeds API uses the following manual configurations to control the importer functionality.
The process settings controls the entites/objects that will be processed in the export.
"processSettings": {
"@odata.type": "Ajsuth.Sample.Discover.Engine.Models.ExportSettings",
"ProcessCategories": false,
"ProcessProducts": false
}
ProcessCategories
: If enabled, translates XC categories into a category feed.ProcessProducts
: If enabled, translates XC sellable items into a product feed.
The site settings is an array of Sitecore storefronts that utilise XC.
"siteSettings": [
{
"@odata.type": "Ajsuth.Sample.Discover.Engine.Policies.SitePolicy",
"Name": "Storefront",
"Catalog": "Habitat_Master",
"Domain": "Storefront",
"Storefront": "Storefront"
}
]
Name
: The name of the site. Found in the Sitecore Content Editor at sitecore/content/content/<tenant>/<site>.
Catalog
: The catalog friendly id associated to the site.
Domain
: The domain association to the site. Found in the Sitecore Content Editor at sitecore/content/content/<tenant>/<site>/settings/sitegrouping/<site group>.
Storefront
: The storefront associated to the site. Found in the Sitecore Content Editor at sitecore/content/content/<tenant>/<site>/settings/commerce/controlpanelconfiguration.
The category settings manages behaviour of the category feed generator.
"categorySettings": {
"@odata.type": "Ajsuth.Sample.Discover.Engine.Policies.CategoryFeedPolicy",
"CategoryFeedFilePath": "C:\\Feeds\\Habitat_category_feed.csv"
}
CategoryFeedFilePath
: The full file path, including file name, of the category feed to be created.
The product settings manages behaviour of the product feed generator.
"productSettings": {
"@odata.type": "Ajsuth.Sample.Discover.Engine.Policies.SellableItemFeedPolicy",
"ProductFeedFilePath": "C:\\Feeds\\Habitat_product_feed.csv",
"IncludeStandaloneProducts": true,
"IncludeProductsWithVariants": false,
"InventorySetId": "Habitat_Inventory",
"DefaultCurrency":"USD",
"IncludeImages": true
}
ProductFeedFilePath
: The full file path, including file name, of the product feed to be created.IncludeStandaloneProducts
: When true, sellable items will be converted to the Sitecore Discover product model. Note: Model 1 is currently not supported.IncludeProductsWithVariants
: When true, sellable items will be converted to the Sitecore Discover product model. Note: Model 1 is currently not supported.InventorySetId
: The inventory set to retrieve the inventory count from. Note: currently only supports single inventory.DefaultCurrency
: The default currency is used to identify which price value to extract from the sellable item's list price.IncludeImages
: If enabled, assumes product images are being served from Azure Storage and will construct urls expecting the image to exist.
The cloud storage settings will be eventually be moved into its own plugin later.
"cloudStorageSettings": {
"@odata.type": "Ajsuth.Sample.Discover.Engine.Policies.CloudStoragePolicy",
"ConnectionString": "",
"BaseUrl": "",
"Container": ""
}
ConnectionString
: The connection string to the storage account.BaseUrl
: The product image urls are generated using the following format,<baseUrl><container>/<sellable item friendly id}/<image file name>
.Container
: The product image urls are generated using the following format,<baseUrl><container>/<sellable item friendly id}/<image file name>
.
- Download the repository.
- Add the Ajsuth.Sample.Discover.Engine.csproj to the Sitecore Commerce Engine solution.
- In the Sitecore Commerce Engine project, add a reference to the Ajsuth.Sample.Discover.Engine project.
- Run the Sitecore Commerce Engine from Visual Studio or deploy the solution and run from IIS.
- Run the Bootstrap command on the Sitecore Commerce Engine.
Feature | Description | Issue |
---|---|---|
The code provided in this repository is sample code only. It is not intended for production usage and not endorsed by Sitecore. Both Sitecore and the code author do not take responsibility for any issues caused as a result of using this code. No guarantee or warranty is provided and code must be used at own risk.