Setting and Displaying Inventory in Custom Catalog Provider

Posted by Community Admin on 05-Aug-2018 21:55

Setting and Displaying Inventory in Custom Catalog Provider

All Replies

Posted by Community Admin on 17-Jun-2014 00:00

Hi,

We have overridden the OpenAccessCatalogDataProvider with our own that searches an external system for product price and inventory.  We are attempting to merge the price and inventory values with the Sitefinity product object and then displayed on the product detail (and list) widgets. The data is correctly set on the (product) object in the provider (inventory should be 203), however the Inventory value is not reflected on the widget but the price is (see attachment - the highlighted inv:0).  

To be sure, I have pre-set the product to be tracked via the Sitefinity UI.  Sample code:

private void updatePrice(Telerik.Sitefinity.Modules.Ecommerce.Catalog.Model.Product product, ExternalProduct externalProduct) 

            product.Price = externalProduct.Price;
            product.Inventory = externalProduct.Inventory.Sum(x => x.AvailableQuantity);
            if (product.Inventory == 0)
           
                product.OutOfStockOption = OutOfStockOption.DisplayButDontAllowOrders;
             

  

 It appears that Sitefinity is somehow removing the inventory value before passing it to the widgets.  Is there something that I maybe missing?

Thanks,
David

This thread is closed