Microsoft Developer Network > Forums Home > Commerce Server Forums > Commerce Server 2009 > How to get Product that is condition of campaign applied
Ask a questionAsk a question
 

Proposed AnswerHow to get Product that is condition of campaign applied

  • Thursday, November 05, 2009 9:07 AMErdem Kemer Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    assume that we have a campaign which has a condition expression (If you buy 2 of "A" product, whose categoryID is XX than you get product "B" free)


    Campaign works perfectly by , i need yo determine information that is , Product A is the reason Product B is free

    is there any way to get this info from userbasket , or user purchaseorder

    Thank you very much

All Replies

  • Thursday, November 05, 2009 9:54 AMRavi Kanth KoppalaMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    No, as per the current architecture this functionality is not supported in commerce server. DiscountApplication record holds discount information and links to discount Id, name, value etc  but not to the product.

    Hope this helps.

    Regards,
    -Ravi Kanth Koppala 
    http://techblog.ravikanth.net (If this post answers your question - Either Mark this post as the answer or vote as being useful.)
  • Thursday, November 05, 2009 12:50 PMErdem Kemer Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    isnt there any chance of simulation of condition selection as below:

    i know condition expression id and products of user basket.

    Programmatically if i create orderform and add products that exists in user basket , and load condition expression and try to evaluate selection by using ExpressionEvaluateor.eval method or something like that ?

    There is expressionevalutor class, but i could not able to use it as i mentioned above.

    Or is there any field on basket line item that holds relation info.

    There is condition Info on award product, on the field "discounts_applied", where you can reach condition expression ID , award expression ID etc,
    but i could not find any field that hold same info , on the condition product.

    All i need is : these products "B" and "A" are related by campaign, i do not care about other conditions like quantity, category condition , user profile condition etc...


    any ideas ?