Umbraco Commerce. How do you handle discounts in t...
# help-with-umbraco
s
Hi all, Umbraco Commerce has a great discount rule engine. The only downside is that it is applied to Orders only. How do you manage displaying discounts on the frontend? A lot of shops don't just want to show the discount whenever they are in the checkout, but also on product details/ product overviews. I know there is no built in feature for this (we asked support) so that's why I was wondering how other people handle this. Thanks
r
I'm not an Umbraco Commerce guru or anything but when you get the Model for a product you can decorate it with any discounts that are available according to any rules... or create a variant with a discounted price?? Maybe @Matt Brailsford could get one of the excellent team at Umbraco to answer this better than I can
s
We are experimenting with different options. Maybe the next stop is to try and work with commerce entity picker and select a discount and see what we get
m
The discount rules are a double edged sword realy. They are super flexible, but it means that they a super contextual. When you have rules that an order must meet certain criteria, it then becomes impossible to know if/when a discount would apply outside of an order context. Should you say there is a 20% on item X, even if you only meet the criteria if you are Member Y, and you have a subtotal greater than £50? This is why we can't know for sure if a discount applies, and by how much. The general options are: 1) Record a "originalPrice" on a product, and just always show that with a strike through on the front end. This means there is a bit of duplication though as you'll need to record the pre discoutned price, and then also setup the discount. 2) I've seen some people create a temporary order, adding the given product to it, and then seeing what discounts apply. Extracting those and then showing them on the product details page. This could get pretty intensive though. 3) I have also seen people query the discounts and just look for ones you know are global discounts, ie, they have no rules, but apply a percentage discount. You could extract those and then dynamically calculate what that discount would be on the price.
r
Cheers @Matt Brailsford (HQ)
s
thanks for your thoughts and feedback @Matt Brailsford (HQ) and @Ravi
l
@Sander L We had a similar issue - client wanted to be able to show both original price and sale price on website. We ended up creating a specific discount for all sale items and check for that discount by alias to determine if item is on sale. It's a bit cumbersome, but works. In the Rules section we do an "Any" match and add an Order Line Product Rule for each item that is on sale. In the Rewards section we add an Order Line (with Product) Amount Reward for each item that is on sale and set price type to Unit Price and then use an Amount adjustment with the amount to take off for each unit of that specific product
s
Thanks, always great to see how other people handle these kind of situations
44 Views