Promo Shout Out Development Guide
The Promo Shout Out Service enables you to determine the promotions that a given SKU features in. You can use this information advertise promotions in the context of products on your category, search results and product pages.
Here we use it to add a Sale sign:
API
There are two APIs. One for Commerce Server 2007 and one for 2009+.
Commerce Server 2007 API
Use the PromoShoutOutService
to get all the shout outs, or just the ones you explicitly configure. Adding the text "ShoutOut" to the Commerce Server discount comment text makes it an explicit shout out.
The following code snippet shows how you access the PromoShoutOutService
.
ListCreatePromoShoutOutDtos(Product product) { //Get the service. var service = PromotionContext.Current().CreatePromoShoutOutService(); //Get the explicitly configured shouts outs //(the ones with ShoutOut in the CS discount comment field) return service .GetPromoShoutOutsForProduct(product, ShoutOutSelection.ExplicitOnly) .Select(PromoShoutOutDto.Create) .ToList(); }
Commerce Server 2009 and 2009 R2 API
The Commerce Server 2009 API is provided by an Operation Sequence Component called PromotionShoutOutComponent
. You can use this on its own in the OperationSequence
element of a MessageHandler
config section.
If you are running Commerce Server 2009 R2 in a 3-tier configuration, you must use this API. If you are running in 2-tier or are using the first version of 2009, you can use this API or the CS 2007 API documented in the previous section.
Following are the steps to setup this API.
1. Make sure Enticify.CommerceServer
is in your bin folder.
2. Add the PromotionShoutOutComponet
to your ChannelConfiguration.config
This is an example MessageHandler
registration. You may need to change the version number.
<MessageHandler name="PromotionShoutOutQueryOperation_PromoShoutOuts" responseType="Enticify.CommerceServer.Components.PromotionShoutOutOperationResponse, Enticify.CommerceServer, Version=3.0.0.0, Culture=neutral, PublicKeyToken=8a030859d27c8274">
<OperationSequence>
<Component name="Promo Shout Outs Component" type="Enticify.CommerceServer.Components.PromotionShoutOutComponent, Enticify.CommerceServer, Version=3.0.0.0, Culture=neutral, PublicKeyToken=8a030859d27c8274" />
</OperationSequence>
</MessageHandler>
3. Call the API using the Enticify PromotionShoutOutQueryOperation
.
var query = new PromotionShoutOutQueryOperation
{
CatalogId = "Adventure Works Catalog",
ProductIds = new string[]{"1234", "5567"},
ShoutOutSelection = ShoutOutSelection.ExplicitOnly,
};
You will get back a PromotionShoutOutOperationResponse
that contains a list of PromotionShoutOutEntity
instances for each shout out!
User Interface
You can use promo shout out data in a number of ways and in a number of places on your site. Therefore, you will need to determine how much work you need to do in order to expose the functionality that you want.