Developer forum

Forum » Development » Dynamicweb.Ecommerce.Common.Context.DisplayPricesWithVat has no effect in ProductViewModel

Dynamicweb.Ecommerce.Common.Context.DisplayPricesWithVat has no effect in ProductViewModel

Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

We see that changing the property: Dynamicweb.Ecommerce.Common.Context.DisplayPricesWithVat has no effect in the ProductViewModel.

Will you please try to look into this?

 

Best regards, Anders


Replies

 
Nicolai Pedersen
Reply

Code and context, please!

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Yes of course! :-)

We have a notification subscriber with this code:

    [Subscribe(Dynamicweb.Notifications.Standard.User.OnExtranetLogin)]
    public class ExtranetLoginObserver : NotificationSubscriber
    {
        public override void OnNotify(string notification, NotificationArgs args)
        {
            if (args is Standard.User.OnExtranetLoginArgs userArgs)
            {
                var user = userArgs.User;
                
                if (user != null)
                {
                    var pricesIncludingVAT = Helper.GetUserCustomField<bool>(user, "SpBcPricesIncludingVAT");
                    Dynamicweb.Ecommerce.Common.Context.DisplayPricesWithVat = pricesIncludingVAT ? true : false;
                }
            }
        }
    }
 
 

And on the ProductViewModel we output Model.Price, with is still including VAT even though DisplayPricesWithVat is false.

 

Best regards, Anders

 
Nicolai Pedersen
Reply

Hi Anders

We think that is TFS#77856 triggered by this thread: https://doc.dynamicweb.com/forum/ecommerce-standard-features?ThreadID=68982

What version is your solution?

BR Nicolai

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

We are using this version: Dynamicweb.Ecommerce.dll 1.8.86 and you can see the issue her: https://www.screencast.com/t/dWRTZrD27kfX. (Output is from @Model.ToJson()).

 

Best regards, Anders

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Are there any progress here?

 

Best regards, Anders

 
Nicolai Pedersen
Reply

Yes, New item TFS#82298 which is due tomorrow with 9.9

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Has this made it into release 9.9 as we still see the same issue?

 

Best regards, Anders

 
Nicolai Pedersen
Reply

Hi Anders

See my dumps. You do something differently?

BR Nicolai

Capture.JPG Capture2.JPG
 
Niels Foldager
Reply

Hi Nicolai,

I have made a support request yesterday, because we still see this issue in DW 9.9 (Case Number:CAS-14110-Q8D3H5). I have tried PricesWithVAT=false and it works fine in ProductListViewModel and probally also in ProductViewModel. Here we now get the price without VAT.

But when using the api, GetProductById and PriceCalculated then the Price is always including VAT. The same error is found when using PageViewModel and rendering orderlines by Model.Cart.CartOrderlines

 

Best regards,
Niels Foldager

 

 

You must be logged in to post in the forum