/// <summary>
        /// Gets the product back-orderable information.
        /// </summary>
        /// <param name="shopName">The shop name.</param>
        /// <param name="stockInformation">The product stock information.</param>
        /// <param name="location">The location.</param>
        public void VisitedProductStockStatus(string shopName, StockInformation stockInformation, string location)
        {
            var request = new VisitedProductStockStatusRequest(shopName, stockInformation)
            {
                Location = location
            };

            this._serviceProvider.VisitedProductStockStatus(request);
        }
        /// <summary>
        /// Visiteds the product stock status.
        /// </summary>
        /// <param name="storefront">The storefront.</param>
        /// <param name="stockInformation">The stock information.</param>
        /// <param name="location">The location.</param>
        /// <returns>The manager response which returns success flag in the Result.</returns>
        public virtual ManagerResponse <VisitedProductStockStatusResult, bool> VisitedProductStockStatus([NotNull] CommerceStorefront storefront, StockInformation stockInformation, string location)
        {
            Assert.ArgumentNotNull(storefront, "storefront");
            Assert.ArgumentNotNull(stockInformation, "stockInformation");

            var request = new VisitedProductStockStatusRequest(storefront.ShopName, stockInformation)
            {
                Location = location
            };
            var result = this._inventoryServiceProvider.VisitedProductStockStatus(request);

            // Helpers.LogSystemMessages(result.SystemMessages, result);
            return(new ManagerResponse <VisitedProductStockStatusResult, bool>(result, result.Success));
        }
コード例 #3
0
        public ManagerResponse <VisitedProductStockStatusResult, bool> VisitedProductStockStatus(StockInformation stockInformation, string location)
        {
            Assert.ArgumentNotNull(stockInformation, nameof(stockInformation));

            if (StorefrontContext.Current == null)
            {
                throw new InvalidOperationException("Cannot be called without a valid storefront context.");
            }

            var request = new VisitedProductStockStatusRequest(StorefrontContext.Current.ShopName, stockInformation)
            {
                Location = location
            };
            var result = InventoryServiceProvider.VisitedProductStockStatus(request);

            result.WriteToSitecoreLog();
            return(new ManagerResponse <VisitedProductStockStatusResult, bool>(result, result.Success));
        }
コード例 #4
0
        /// <summary>
        /// Visiteds the product stock status.
        /// </summary>
        /// <param name="storefront">The storefront.</param>
        /// <param name="stockInformation">The stock information.</param>
        /// <param name="location">The location.</param>
        /// <returns>The manager response which returns success flag in the Result.</returns>
        public virtual ManagerResponse<VisitedProductStockStatusResult, bool> VisitedProductStockStatus([NotNull] CommerceStorefront storefront, StockInformation stockInformation, string location)
        {
            Assert.ArgumentNotNull(storefront, "storefront");
            Assert.ArgumentNotNull(stockInformation, "stockInformation");

            var request = new VisitedProductStockStatusRequest(storefront.ShopName, stockInformation) { Location = location };
            var result = this.InventoryServiceProvider.VisitedProductStockStatus(request);

            Helpers.LogSystemMessages(result.SystemMessages, result);
            return new ManagerResponse<VisitedProductStockStatusResult, bool>(result, result.Success);
        }