Copied to clipboard

Flag this post as spam?

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


  • Kurt Moskjaer Andersen 40 posts 95 karma points
    Feb 06, 2018 @ 07:38
    Kurt Moskjaer Andersen
    0

    Recalculate orderline discount

    Hi,

    I need to recalculate the discount per orderline from a custom property on the product, if the custom property is present (has a value).

    I've tried to make an Order Line Calculator, as suggested in another thread, but this "just" updates the products price, which is not what I need.

    Would the right step be to hook into the NotificationCenter.Order.OrderLinesAdding/Added and change the discount on the specific orderline?

    --

    Best regards

    Kurt Moskjaer Andersen

  • Rune Grønkjær 1296 posts 2863 karma points
    Feb 07, 2018 @ 07:14
    Rune Grønkjær
    0

    Hi Kurt,

    Have you tried using the Marketing module, which can do just that?

    /Rune

  • Kurt Moskjaer Andersen 40 posts 95 karma points
    Feb 07, 2018 @ 09:39
    Kurt Moskjaer Andersen
    0

    Hi Rune,

    Yes, but my task is a little special :)

    My customer wants to apply the discount on a custom property of the product called "Vejledende pris" (indicative price), if the property is filled. If not, the discount should be applied to the unitprice.

    /Kurt

  • Rune Grønkjær 1296 posts 2863 karma points
    Feb 07, 2018 @ 10:37
    Rune Grønkjær
    0

    I'm pretty sure you can do that with maybe two different marketing campaigns. Each of them should handle one of your scenarios and apply the discount in different ways.

    Otherwise the correct procedure would be to make a custom rule and/or a custom award. How the default rules and awards is set up can be seen here: https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/tree/master/Source/TeaCommerce.Umbraco.Configuration/Marketing/Models https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/tree/master/Source/TeaCommerce.Umbraco.Application/Marketing

    /Rune

  • Kurt Moskjaer Andersen 40 posts 95 karma points
    Feb 07, 2018 @ 11:46
    Kurt Moskjaer Andersen
    0

    Could you perhaps elaborate how you would do this with different builtin marketing campaigns?

    I think using a rule group with a property rule inside?

    /Kurt

Please Sign in or register to post replies

Write your reply to:

Draft