I need to be able to change the pricing for a product based on the quantity ordered. So for example if the user orders 1-5 then it costs $5, 6- 10 costs $4.50 etc.
Is there a built in way to do this in Tea Commerce 2.1.1 (or higher) (I note that it wasn't possible in previous versions) or am I going to need to hit the .NET api? If so is there any sample code for overriding the order line pricing calculation?Thanks
Here is a simple example. The price is hardcoded here. What you could do it to fetch the price from a custom xml field on your Umbraco product node or what ever way works for your case.
using TeaCommerce.Api.Dependency; using TeaCommerce.Api.InformationExtractors; using TeaCommerce.Api.Models; using TeaCommerce.Api.PriceCalculators; using TeaCommerce.Api.Services;
namespace CustomShippingProject { [SuppressDependency( "TeaCommerce.Api.PriceCalculators.IOrderCalculator", "TeaCommerce.Api" )] public class CustomOrderCalculator : OrderCalculator {
Pricing based on quantity
Hello
I need to be able to change the pricing for a product based on the quantity ordered. So for example if the user orders 1-5 then it costs $5, 6- 10 costs $4.50 etc.
Is there a built in way to do this in Tea Commerce 2.1.1 (or higher) (I note that it wasn't possible in previous versions) or am I going to need to hit the .NET api? If so is there any sample code for overriding the order line pricing calculation?Thanks
Hi Laurie
Here is a simple example. The price is hardcoded here. What you could do it to fetch the price from a custom xml field on your Umbraco product node or what ever way works for your case.
Kind regards
Anders
Thanks, that works perfectly.
is working on a reply...