Setting and Displaying Inventory in Custom Catalog Provider - Ecommerce - Ecommerce - Progress Community

Setting and Displaying Inventory in Custom Catalog Provider

 Ecommerce

Setting and Displaying Inventory in Custom Catalog Provider

  • Setting and Displaying Inventory in Custom Catalog Provider
  • 4a344f1e-37c1-6deb-a958-ff0000446526_availabilityexample.png

    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