Hi,
Is there any way to access the AvailableAmount (TT: Ecom:Product.AvailableAmount) via the API?
Kind regards,
Vincent
Hi,
Is there any way to access the AvailableAmount (TT: Ecom:Product.AvailableAmount) via the API?
Kind regards,
Vincent
Hi Vincent
Try something like this:
Dynamicweb.Ecommerce.Products.Product product = Ecommerce.Services.Products.GetProductById("PROD1", "VariantID", "Lang1"); string unitid = "unit1"; Stocks.StockLocation stocklocation = Ecommerce.Services.StockService.GetStockLocation("location1"); double reservedStock = Dynamicweb.Ecommerce.Frontend.Cart.ProductReserve.GetReservedAmount(product.Id, product.VariantId); double unitStock = product.GetUnitStock(stocklocation, unitid); double availableAmount = unitStock - reservedStock;
BR Nicolai
Thanks!
You must be logged in to post in the forum