Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Nickolaj 12 posts 32 karma points
    Apr 02, 2012 @ 09:05
    Nickolaj
    0

    Identify campaign matching voucher code

    Hello:)

    Im looking for a way to identify what Marketing campaign match the entered voucher code, how can i do that?

  • Nickolaj 12 posts 32 karma points
    Apr 02, 2012 @ 09:22
    Nickolaj
    0

    Edit is failing so:
    Its the marketing campaignItem im after, not the campaign :) 

  • Søren Spelling Lund 1797 posts 2786 karma points
    Apr 24, 2012 @ 08:32
    Søren Spelling Lund
    0

    That information is copied to the applied discount on the order.

    Do you need to find it before it's applied to the order?

  • Nickolaj 12 posts 32 karma points
    Apr 24, 2012 @ 12:08
    Nickolaj
    0

    No - i just need it in the basket (when its applied).

    So i would have to use the CampaignItemName found in PurchaseOrder.Discounts to find the applied Award item? (i need the type of award fx. PercentOffOrderTotalAward, not just the AmountOffTotal found in the discount list)

  • Søren Spelling Lund 1797 posts 2786 karma points
    Apr 24, 2012 @ 13:04
    Søren Spelling Lund
    0

    The discount will have the Campaign Item name on it, but you't tell the type from a discount. It's a generic thing used for all discount types.

  • Nickolaj 12 posts 32 karma points
    Apr 25, 2012 @ 08:06
    Nickolaj
    0

    So there is no other way then this (pretty ugly one)?:

    Build a list of discount.CampaignItemNames, find generic awards, and foreach of them and then: 


    var amountOffOrderTotalAward = AmountOffOrderTotalAward.FirstOrDefault(y => y.AwardId == award.AwardId);
    if(amountOffOrderTotalAward != null)
    //its a amountOffOrderTotalAward type

     

     

     

  • Søren Spelling Lund 1797 posts 2786 karma points
    Apr 25, 2012 @ 10:05
    Søren Spelling Lund
    0

    The question is: What do you need it for?

    It seems to me that there might be a better way of solving it; I just don't know what you're trying to achieve :)

  • Nickolaj 12 posts 32 karma points
    Apr 25, 2012 @ 12:48
    Nickolaj
    0

    Im looking for a way to determine (and show) what award the customer gets when he/she inputs a voucher code.

    fx. 10% discount

  • Søren Spelling Lund 1797 posts 2786 karma points
    Apr 30, 2012 @ 08:35
    Søren Spelling Lund
    0

    Ah, makes sense you can look up a particular promocode by queyring Marketing Foundation:

    var promocode = VoucherCode.SingleOrDefault(x => x.Code == "MyCode");
    if (promocode == null) return;
    var campaignItem = promocode.VoucherTarget.CampaignItem;
    var awards = Award.All().Where(x => x.CampaignItem ==  campaignItem);
Please Sign in or register to post replies

Write your reply to:

Draft