Copied to clipboard

Flag this post as spam?

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


  • David Peck 615 posts 1646 karma points c-trib
    Jan 29, 2021 @ 06:51
    David Peck
    0

    Preventing discounts on some products

    I have a category of products (defined by a product/order line property) which must never have a discount applied.

    I'm aware that it is possible to configure a discounts to exclude these products when it is configured through the UI. However I'm hoping to find a client-proof way of achieving that, by implementing a hard coded rule.

    Is there perhaps an adjuster that I could override to achieve this?

    Thank you in advance.

  • David Peck 615 posts 1646 karma points c-trib
    Jan 29, 2021 @ 07:02
    David Peck
    0

    I may have found my answer in CalculateOrderAdjustedPricesPipeline? I'll investigate that at my next opportunity.

  • Matt Brailsford 2958 posts 15629 karma points MVP 7x c-trib
    Jan 29, 2021 @ 09:41
    Matt Brailsford
    100

    Hmm,

    Just thinking, one thing you could try doing is creating your own Order Line Product Rule inheriting from the default and have that auto filter out products that must never be discounted.

    I think you could then force the original discount rule to be removed by calling

    composition.WithCollectionBuilder<DiscountRuleProviderCollectionBuilder>()
        .Exclude<OrderLineProductDiscountRuleProvider>();
    

    I've never tried this, but could be worth a shot.

    Matt

  • David Peck 615 posts 1646 karma points c-trib
    Feb 10, 2021 @ 11:52
    David Peck
    1

    This did work, but I needed to remove some additional rules/rewards to prevent their use.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies