// Fills the values from Response on the Product
        public static void FillProductValues(Product product, double quantity = 1)
        {
            if (product != null && ErpResponseCache.IsProductInCache(ProductCacheLevel, Helpers.ProductIdentifier(product)))
            {
                Dictionary <string, ProductInfo> piCache = ErpResponseCache.GetProductInfos(ProductCacheLevel);
                if (piCache.ContainsKey(Helpers.ProductIdentifier(product)))
                {
                    ProductInfo productInfo = piCache[Helpers.ProductIdentifier(product)];

                    double?newStock = (double?)productInfo["Stock"];

                    if (newStock.HasValue && product.Stock != newStock)
                    {
                        product.Stock = newStock.Value;
                        product.Save();
                        productInfo["Stock"] = null;
                    }
                    //product.Stock = (double)productInfo["Stock"];

                    FillProductPrices(product, productInfo);

                    double?priceValue = SelectPrice(productInfo, quantity) * product.GetUnitPriceMultiplier();

                    product.Price.PriceWithoutVAT = priceValue.GetValueOrDefault(); // NOTE accessing the Price property, will trigger the price provider to kick in
                    product.Price.PriceWithVAT    = priceValue.GetValueOrDefault();

                    //Update Product Custom Fields
                    if (AddProductFieldsToRequest && product.ProductFieldValues.Count > 0)
                    {
                        foreach (var pfv in product.ProductFieldValues)
                        {
                            if (productInfo.ContainsKey(pfv.ProductField.SystemName))
                            {
                                pfv.Value = productInfo[pfv.ProductField.SystemName];
                            }
                        }
                    }
                }
            }
        }