Created
March 28, 2012 13:50
-
-
Save bentayloruk/2226337 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ProductDisplayWithPromoInfo | |
{ | |
public ProductDisplayDto CreateProductDisplayDto(Product product) | |
{ | |
//Get the PromoShoutOutService | |
var shoutOutService = PromotionContext.Current().CreatePromoShoutOutService(); | |
//Get the explicitly configured shouts outs for the product (the ones with ShoutOut in the CS discount comment field) | |
var productPromoShoutOuts = shoutOutService.GetPromoShoutOutsForProduct(product, ShoutOutSelection.ExplicitlyConfiguredForShoutOut); | |
foreach (var skuInPromotionShoutOut in productPromoShoutOuts) | |
{ | |
//Let's look at the data we could use in the category, search or product page listings... | |
// skuInPromotionShoutOut.ShoutOut.Text // Nice message for customer like "3 for 2 on XBox Games!" | |
// skuInPromotionShoutOut.Sku.ProductId | |
// skuInPromotionShoutOut.Sku.CatalogName | |
// skuInPromotionShoutOut.SkuIsAwardOfPromotion | |
// skuInPromotionShoutOut.SkuIsConditionOfPromotion | |
} | |
return ProductDto.CreateFrom(product, productPromoShoutOuts); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment