/// <summary> /// Registers an event specifying that the category page has been visited. /// </summary> /// <param name="storefront">The storefront.</param> /// <param name="categoryId">The category identifier.</param> /// <param name="categoryName">The category name.</param> /// <returns> /// A <see cref="CatalogResult" /> specifying the result of the service request. /// </returns> public CatalogResult VisitedCategoryPage([NotNull] CommerceStorefront storefront, [NotNull] string categoryId, string categoryName) { Assert.ArgumentNotNull(storefront, "storefront"); var request = new VisitedCategoryPageRequest(storefront.ShopName, categoryId, categoryName); return(this.CatalogServiceProvider.VisitedCategoryPage(request)); }
public void VisitedCategoryPage(string shopName, string categoryId, string categoryName) { Assert.IsNotNullOrEmpty(categoryId, nameof(categoryId)); Assert.IsNotNullOrEmpty(categoryName, nameof(categoryName)); var request = new VisitedCategoryPageRequest(shopName, categoryId, categoryName); this.catalogServiceProvider.VisitedCategoryPage(request); }
public CatalogResult VisitedCategoryPage(string categoryId, string categoryName) { if (StorefrontContext.Current == null) { throw new InvalidOperationException("Cannot be called without a valid storefront context."); } var request = new VisitedCategoryPageRequest(StorefrontContext.Current.ShopName, categoryId, categoryName); return(CatalogServiceProvider.VisitedCategoryPage(request)); }
/// <summary> /// Visiteds the category page. /// </summary> /// <param name="storefront">The storefront.</param> /// <returns> /// The manager response /// </returns> public virtual ManagerResponse <VisitedCategoryPageResult, bool> VisitedCategoryPage([NotNull] CommerceStorefront storefront) { Assert.ArgumentNotNull(storefront, "storefront"); var request = new VisitedCategoryPageRequest(storefront.ShopName, CatalogUrlManager.ExtractItemIdFromCurrentUrl()) { CatalogName = CatalogUrlManager.ExtractCatalogNameFromCurrentUrl() }; var result = this.CatalogServiceProvider.VisitedCategoryPage(request); if (!result.Success) { Helpers.LogSystemMessages(result.SystemMessages, result); } return(new ManagerResponse <VisitedCategoryPageResult, bool>(result, result.Success)); }