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.

  • Simon Osborne 108 posts 150 karma points
    Apr 17, 2012 @ 15:49
    Simon Osborne
    0

    Discount orderline in new custom Award

    I have written a new custom award and idetified the orderline I wish to discount. How do you discount the orderline programatically? None of the following seem to work and there is no documentation.

    E.g.

    ol.Discount = 100
    ol.Save()

    Or

    Dim disc As New Discount
    disc.AmountOffTotal = ol.Price
    disc.Save()
    ol.AddDiscount(disc)
    ol.Save()


    Or

    Dim percOff As New PercentOffOrderLinesAward
    percOff.PercentOff = 100
    percOff.Apply(order, ol)
    ol.Save()

    (bit weird though applying an award from an award!)

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

    Discount has to be added to the order itself and the relevant order line like so:

    Dim disc AsNewDiscount
    disc
    .AmountOffTotal= ol.Price
    ol
    .AddDiscount(disc)
    order.AddDiscount(disc)
Please Sign in or register to post replies

Write your reply to:

Draft