Copied to clipboard

Flag this post as spam?

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


  • Sue Taylor 21 posts 102 karma points
    Feb 07, 2023 @ 17:46
    Sue Taylor
    0

    Discounts with price type of Base Price not working as excepted

    Hi I'm struggling with discounts not working as I think they should! I don't know if this is due to misunderstanding on my part or some customisations we have, but any help would be much appreciated. I am on vendr 3.0.6 and Umbraco 10.

    I have a discount code set up for 10% off the base price of a certain product. enter image description here

    This reduces the price from £12.50 to £11.25 which displays at checkout.

    Incidentally I am having to use this to get the discount:

    vendrOrder?.TotalPrice?.TotalAdjustment?.WithTax
    

    ...because the following code is returning 0:

    vendrOrder?.GetTotalPriceAdjustmentByType<DiscountAdjustment>().WithTax
    

    This is not nice as I do have other adjustments which I am having to remove manually!

    That aside, all is well until the order finalises and appears in the order manager then no discount can be seen. In code, the discount is there but IsFulfilled has changed from true to false somewhere after the order finalised event occurs. The customer pays £11.25 but the order total is £12.50. enter image description here

    When I do the exact same with a discount based on Total Price it works as expected and the discount is visible in the final order: enter image description here

    Any idea if I am missing something?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Feb 08, 2023 @ 09:06
    Matt Brailsford
    0

    So Base prices only really apply to Bundle order lines and so as you aren't using bundles, I'd suggest you switch your discount to be a Unit Price discount.

    The difference is that when using Bundles the base price is the base unit price of the item that is the bundle, but it's order line unit price is made up of the base price and the bundled item unit prices added together and so we needed a way to allow a discount to only affect that price.

    It may be because your order line isn't a bundle it's loosing the discount. So, I'd suggest trying a unit price discount and see if that does the same.

  • Sue Taylor 21 posts 102 karma points
    Feb 16, 2023 @ 16:52
    Sue Taylor
    0

    Thanks Matt, it works fine with Unit Price.

    Is there 'end user' documentation on discounts, for an umbraco user setting them up?

    Thanks, Sue

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Feb 17, 2023 @ 09:48
    Matt Brailsford
    0

    Hi Sue,

    Glad it works.

    RE docs, unfortunately this is one area we haven't done a lot of documenting I'm affraid. I'll add it to the docs issue tracker though as a reminder to take a look when we can.

Please Sign in or register to post replies

Write your reply to:

Draft