I'm using the below Vendr (3.0.0-rc0050) method to find out if a product has any stock.
var currentStock = _vendrApi.GetProductStock(storeId, productReference);
The issue I'm experiencing is that stock is being returned from products that have been unpublished or deleted. Note the only way to get 0 back is to delete the product from recycle bin.
Are there any Vendr methods that caters for unpublished or deleted products? I.e if a product page is unpublished or deleted I would expect the stock level returned to be 0.
Vendr GetProductStock method
Hi,
I'm using the below Vendr (3.0.0-rc0050) method to find out if a product has any stock.
The issue I'm experiencing is that stock is being returned from products that have been unpublished or deleted. Note the only way to get 0 back is to delete the product from recycle bin.
Are there any Vendr methods that caters for unpublished or deleted products? I.e if a product page is unpublished or deleted I would expect the stock level returned to be 0.
Thanks Stewart
Hi Stewart,
The
GetProductStock
method will return a stock level for a given product reference regardless of the products state.What is the surrounding code to this? Could you pre filter before this code to exclude product nodes that are unpublished / trashed?
is working on a reply...