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.

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jan 09, 2013 @ 17:30
    David Brendel
    0

    VoucherCode differentiation for Basket and OrderLine

    Hey everybody,

    i need some help with voucher codes. I need to add support for % vouchers and gladly ucommerce can do it.

    The problem is, that i must differentiate if the voucher entered is for an OrderLine or the whole PurchaseOrder. I know that i can lookup in PurchaseOrder.Discounts and in OrderLine.Discounts if i got some vouchers. But sadly the voucher for a single product is also found in the PuchaseOrder.Discounts (of course thats right because it belongs to the PurchaseOrder).

    Is there a way to check in the PurchaseOrder.Discounts if its for an OrderLine and for what specific OrderLine? Or is there any other way how i can achieve that?

    Thanks in advance.

    David

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jan 14, 2013 @ 09:34
    Søren Spelling Lund
    1

    You can find all discounts that belong to order lines with the following piece of code:

    var discountsThatBelongToOrderLines = purchaseOrder.Discounts.Where(x => x.OrderLines.Any());

    Hope this helps.

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jan 14, 2013 @ 09:55
    David Brendel
    100

    Hi Soren,

    thanks for the help. I got it working on friday with a method similar to yours.

    The only difference is that i loop through all discounts and check some more custom stuff because i have to manage normal and percentage discounts in a different way.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jan 14, 2013 @ 10:02
    Søren Spelling Lund
    0

    Excellent. Thanks for posting your findings on the forum. Appreciate that!

Please Sign in or register to post replies

Write your reply to:

Draft