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.

  • Jais Edelmann 45 posts 126 karma points
    Aug 06, 2012 @ 20:24
    Jais Edelmann
    0

    Vouchers?

    Running veresion: 2.1 of ucommerce.

    Im trying to get some voucher codes to go in to my order, however it doesent seem to be happening.

    But im not entirely sure that im using the right method to execute my voucher.

    Ucommerce.Xslt.Library.AddVoucher(string)

    Also where would i go about validating a voucher before trying to execute it? I would like some logic to handle if voucher doesent exisist or alrdy have been used.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Aug 07, 2012 @ 10:18
    Søren Spelling Lund
    0

    The simplest is to look up the voucher code in question like this:

    bool voucherOK = VoucherCodes.All().Any(x => x.Code == "somecode" && x.MaxUses > x.NumberUsed && x.VoucherTarget.CampaignItem.Campaign.Enabled && x.VoucherTarget.CampaignItem.Campaign.StartsOn <= DateTime.Now && x.VoucherTarget.CampaignItem.Campaign.EndsOn >= DateTime.Now);

    A different option is to add the voucher to the basket, execute the basket pipline, and check if you got a new discount with the campaign item name as the name.

Please Sign in or register to post replies

Write your reply to:

Draft