Developer forum

Forum » Ecommerce - Standard features » OrderFeeProvider issue

OrderFeeProvider issue

Peter Leleulya
Reply

Hi guys,

I have a question about the feeprovider in 8.9.1.7.
My product prices are set to prices including VAT.
My settings in the advanced cart properties are set to "Calculate % shipment costs incl VAT".
But with or without this checkbox set, the value is always interpreted in a way I don't want.

I stripped down the fee provider below to the bare bone.

I have a Product of EUR 10.00
The fee provider returns a price raw value of 100.00

I would expect the order price before fees to become 10.00
I would expect the Shipping fee to become 100.00
I would expect the order total price to become 110.00
But it doesn't

The price before fees is 10.00
The shipping fee is 82.64
The total price is 92.64

Somehow it takes the 100.00, then removes 21% (VAT) and uses the remainder as fee.

What can I do to get 100.00 as shipping fee??

namespace MyProject.Providers
{
    public class MyOrderFeeProvider : FeeProvider
    {
        public override PriceRaw FindFee(Order Order)
        {
            double shippingFee = 100.00;
            return new PriceRaw(shippingFee, Dynamicweb.eCommerce.Common.Application.DefaultCurrency);
        }
    }
}


Replies

 
Alexander Gubenko
Reply

Hi Peter,

Go to prices page ("Management Center => "Ecommerce => "Advanced configuration" => Prices) find and uncheck "Calculate VAT on fees" => Shipment checkbox there.

It should help you with the your issue.

-Alexander

 

 

 
Peter Leleulya
Reply

Hi Alexander,
Thanks for your reaction.
But as I mentioned in the description of this issue, the setting set to true or false doesn't do a thing for the outcome this is always the same.

Well, the value the provider returns is exactly what I want, the 100.0 in my example.
The value which is set as shipment fee value on the order is always the same value (with the setting set to true or false) and it is the value that I DO NOT want, the 82.64 in my example.

 

 

 
Alexander Gubenko
Reply

I don't sure that we say about one thing.
Please make sure that checkbox from attached image is unchecked in your solution.

2017-02-17_1723.png
 
Peter Leleulya
Reply

Excuse the dutch language, but I think you can understand these settings ...
This is wat I have set at the moment ...

 
Alexander Gubenko
Reply

Hi Peter,

Your solution have marked with "Prices in the database include VAT" setting. It means that DWCMS will remove VAT from Price to calculate PriceWithoutVAT. And use it for other calculations.So I suggest next:

  • Suggestion 1: Unmark 2 settings("Prices in the database include VAT", "Calculate VAT on fees" => Shipment). Don't forget to iisreset (for clean cart cache for all users).
  • Suggestion 2: If "Prices in the database include VAT" setting is important for your solution you can try to setup SystemVat value equal to CountryVat and mark "Calculate VAT on fees" => Shipment setting.
  • Suggestion 3: if 1 and 2 is still not what you want. You should to change feeprovider source to use the code from attachment.

 

You must be logged in to post in the forum