Created
March 14, 2012 14:33
-
-
Save bentayloruk/2036897 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
using Microsoft.CommerceServer.Catalog; | |
using Microsoft.CommerceServer.Runtime.Profiles; | |
namespace Enticify.CommerceServer.Tests.Scenarios | |
{ | |
public class PromoInfoSourceApi | |
{ | |
public void GetPromoInfoForProductAndDoSomething(Product csProduct, Profile csUserProfile) | |
{ | |
var promotionQueryService = new PromotionQueryService(); | |
var promosTargetingProductQuery = new PromotionsTargetingProductQuery(csProduct) | |
{ | |
AvailableToUser = csUserProfile, | |
}; | |
ProductPromotionResults productPromotionResults = promotionQueryService.GetPromotions(promosTargetingProductQuery); | |
if (!productPromotionResults.HasPromotionsTargetingProduct) | |
return; | |
//Do something cool with the data. | |
var conditionInfos = productPromotionResults.WhereConditionOnly; | |
var awardInfos = productPromotionResults.WhereAwardOnly; | |
var conditionAndAwardInfos = productPromotionResults.WhereConditionAndAward; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment