Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm using Umbraco 7.2.4 with Tea Commerce 3.0.2 for Umbraco 7
The price is updated according to some complex logic stored in an archetype based on chosen options for the product.
I'd like to use a custom orderline price calculator to calculate the price based upon the selected options.
When I try to use the example in the documentation https://documentation.teacommerce.net/net-api/price-calculators/order-line-calculator/ for the Order Line Calculator
I get a build error:
Error 1 'DavidThornber.TC.CustomOrderLineCalculator.CalculatePrice(TeaCommerce.Api.Models.OrderLine, TeaCommerce.Api.Models.Currency, TeaCommerce.Api.Models.Order)': cannot change access modifiers when overriding 'public' inherited member 'TeaCommerce.Api.PriceCalculators.OrderLineCalculator.CalculatePrice(TeaCommerce.Api.Models.OrderLine, TeaCommerce.Api.Models.Currency, TeaCommerce.Api.Models.Order)' D:\Projects\etch\david-thornber\DavidThornber.TC\PriceCalculators.cs 16 30 DavidThornber.TC
using TeaCommerce.Api.Dependency; using TeaCommerce.Api.InformationExtractors; using TeaCommerce.Api.Models; using TeaCommerce.Api.PriceCalculators; using TeaCommerce.Api.Services; namespace DavidThornber.TC { [SuppressDependency( "TeaCommerce.Api.PriceCalculators.IOrderLineCalculator", "TeaCommerce.Api" )] public class CustomOrderLineCalculator : OrderLineCalculator { public CustomOrderLineCalculator( IVatGroupService vatGroupService, IProductInformationExtractor productInformationExtractor ) : base( vatGroupService, productInformationExtractor ) { } protected override Price CalculatePrice( OrderLine orderLine, Currency currency, Order order ) { return new Price( 100M, orderLine.VatRate, currency ); } } }
solution seems to be very simple
i changed protected to public and it compiles fine :)
is working on a reply...
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.
Continue discussion
custom orderline price calculator
I'm using Umbraco 7.2.4 with Tea Commerce 3.0.2 for Umbraco 7
The price is updated according to some complex logic stored in an archetype based on chosen options for the product.
I'd like to use a custom orderline price calculator to calculate the price based upon the selected options.
When I try to use the example in the documentation https://documentation.teacommerce.net/net-api/price-calculators/order-line-calculator/ for the Order Line Calculator
I get a build error:
Error 1 'DavidThornber.TC.CustomOrderLineCalculator.CalculatePrice(TeaCommerce.Api.Models.OrderLine, TeaCommerce.Api.Models.Currency, TeaCommerce.Api.Models.Order)': cannot change access modifiers when overriding 'public' inherited member 'TeaCommerce.Api.PriceCalculators.OrderLineCalculator.CalculatePrice(TeaCommerce.Api.Models.OrderLine, TeaCommerce.Api.Models.Currency, TeaCommerce.Api.Models.Order)' D:\Projects\etch\david-thornber\DavidThornber.TC\PriceCalculators.cs 16 30 DavidThornber.TC
solution seems to be very simple
i changed protected to public and it compiles fine :)
is working on a reply...
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.