Developer forum

Forum » Ecommerce - Standard features » Orderline product autoid=0 causing slowness on cart

Orderline product autoid=0 causing slowness on cart

Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi there,

The Avalara Tax Provider creates tax orderlines to the order. We started to see some slowness when the tax provider was active.
We narrow down the issue to the FindPrice method, which is filtering the EcomPrices table for the current product. Although in the tax provider orderlines we are not setting a product, it seems that the new OrderLine() method retrieves a new product with AutoId=0.
This causes a EcomPrices table lookup without filtering by any product, since our EcomPrices table has more than 500k records is taking a lot to load the minicart/cart json feed. https://www.screencast.com/t/Yh1kLCKT

Using a custom Avalara Tax Provider we tried to set the orderline product to null, but that wasn't adding the orderline to the order.

This might be happening with any provider that adds non product orderlines to the order.
A suggestion is to filter the products collection on the FindPrice method that have a valid AutoId, and retrieve the proper products collection that can be used in any PriceProvider.

Thanks,
BR, Mario


Replies

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

bump

 
Viktor Letavin Dynamicweb Employee
Viktor Letavin
Reply

Hi Mario,

Could you please clarify what do you mean with "new product with AutoId=0"? In default behaviour tax lines created with onderline productid=null, so those order lines doesn't have product instance with "Autoid=0", so there is no price lookup on it. Furthermore we have cached results after they retrieved, so I actually not able to locate the problem.

BR, Viktor.

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi Mario,

and please point DW version used.

BR, Oleg QA 

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi guys,

 

@Viktor - The issue is not on the productid property. When a new orderline object is created, the orderline Product property get's an empty product with AutoId=0. So the price provider will look for product autoid=0.

 

@Oleg - DW 9.6.12 - it was showing on screencast so didn't wrote it wink

 

Thanks!

BR, Mario

 
Viktor Letavin Dynamicweb Employee
Viktor Letavin
Reply

Hi Mario,

much appreciate your additional info, now I see that we have a problem, fixing the underlying "When a new orderline object is created, the orderline Product property get's an empty product" probalby will have to big impact on code, so we will see whether it will be fix for prices specifically or a general change.

As additional note I can say that in stock rapido the issue cannot be reproduced since cart rendering doesn't touch the tags who will look into prices like on your example. The query to get all prices only could trigger if you have templatetags in cart json template or have something like orderline.GetDouble("Ecom:Product.Price.Price"). Which is not really needed in cart.js where you have orderline.GetString("Ecom:Order:OrderLine.Price").

BR, Viktor.

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi Viktor,

The issue is also triggered when using the loop orderline.GetLoop("Product.Prices"), so basically anytime the price provider is called. Could you provide a TFS number so we can keep track of this?

BR, Mario

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Any thoughts on this?

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi,

The issue is bugged by TFS 72217.

BR, Oleg QA

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Thanks for the update, Oleg.

BR, Mario

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Mario

The problem #72217 regarding Orderline product autoid=0 causing slowness on cart

Has now been resolved in Dynamicweb version 9.7.5

To upgrade please choose version from download

https://doc.dynamicweb.com/downloads/releases

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum