Product feeds developer information
Design
Model
The product feed build process uses the catalog post processing mechanism to process the products (more information can be found here).
The BuildProductFeedProcessor
reads the configured product feeds from the settings and creates a ProductFeedBuilder
for each product feed. The ProductFeedBuilder
processes each product. The SeoMappingBuilder
is also used to build up a lookup table of the SEO values used for the product URL's in the product feed.
After processing all products each product feed is saved using ProductFeedStorage
which calls the pipeline named mercury.productfeed.savedata
for saving the data.
Build product feed sequence diagram
The BuildProductFeedProcessors
uses the IFeedRepository
to retrieve all the configured product feeds of the website. This is a list of ProductFeed
objects which contains the configured settings and the transformation FeedTransformation
that needs to be applied to the product feed.
The ProductFeedBuilder
build up a list of ProductFeedListItem
of each product by calling the pipeline named mercury.EnrichProductFeedItems
. This pipeline maps the product to a ProductFeedListItem
items with its variants (ProductVariantFeedListItem
).
Build product feed class diagram
Configuration
The process for the generation of the product feed is configured in the catalogPostProcessor
configuration section. For more information, see the catalog post processing article.
Extension points
Pipelines
The following pipelines are offered as extension points for customization:
- mercury.productfeed.savedata
- mercury.productfeed.getdata
mercury.productfeed.savedata
This pipeline saves the product feeds.
Mercury provides a processor for saving the product feeds to the Sitecore media library. This processor also applies the feed transformations before saving the resulting product feeds. The processor is located in the namespace Mercury.Feature.ProductFeeds.Pipelines.SaveData
.
mercury.productfeed.getdata
This pipeline retrieves the product feed. Because the product feed items aren't required by other modules but just served by the website, the pipeline returns the product feed as stream.
Mercury provides a processor for retrieving the product feed from the Sitecore media library and is located in the namespace Mercury.Feature.ProductFeeds.Pipelines.GetData
.
Configure scheduler
Mercury provides Command
items for the catalog post processing job so this can be scheduled.
The product feed catalog post processing jobs can be scheduled as follow:
- Create a schedule item in Sitecore
- Configure the schedule item
- Command:
/sitecore/system/Tasks/Commands/Mercury ProductFeeds/RebuildProductFeedCommand
- Items: The feed transformation item
- Schedule: Schedule when task should run
- Command: