Developer forum

Forum » Ecommerce - Standard features » Get number of units already in cart for this product

Get number of units already in cart for this product

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

For a B2B scenario, I need to display in the product list, the number of units already in the Cart for each product in the list.

Is there any tag already rendering this info on the Product List? I see there is one rendering if the product is in the cart but I can't see one for the actual quantity.

If not, what would be the most efficient way of getting this info?

I am using DW 9.8.9

Thank you,

Adrian


Replies

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi,

The tag seems not to be exist currently. Existing Ecom:Product.ReservedAmount and Ecom:Product.AvailableAmount (if appropriate option is enabled) use total amount regardless product unit added to cart. Tags output by 'StockUnits' loop on specific product are not under the feature and updated after checkout only.

BR, Oleg QA 

 
Nicolai Pedersen
Reply

Hi Adrian

There is no built in performant way to achieve this.

You will have to iterate the cart lines when the product list rendering starts and ensure you have something you can look up in to display the information without performance loss.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

Thank you very much for the feedback.

I will try to convince the client to forget about this request as it seems to be a bad choice for performance.

Thank you,
Adrian

 

You must be logged in to post in the forum