/// <summary>
 /// Builds a <see cref="AddItemModel"/> from <see cref="IProductContent"/>.
 /// </summary>
 /// <param name="product">
 /// The product.
 /// </param>
 /// <param name="currency">
 /// The currency.
 /// </param>
 /// <param name="showWishList">
 /// The show wish list.
 /// </param>
 /// <returns>
 /// The <see cref="AddItemModel"/>.
 /// </returns>
 public static AddItemModel BuildAddItemModel(this IProductContent product, ICurrency currency, bool showWishList)
 {
     return(new AddItemModel()
     {
         Product = product.AsProductDisplay(),
         ContentId = 0,
         BasketPageId = BazaarContentHelper.GetBasketContent().Id,
         ShowWishList = showWishList,
         WishListPageId = BazaarContentHelper.GetWishListContent().Id,
         Currency = currency
     });
 }
 /// <summary>
 /// Gets a <see cref="ProductBoxModel"/> from <see cref="IProductContent"/>.
 /// </summary>
 /// <param name="product">
 /// The product.
 /// </param>
 /// <returns>
 /// The <see cref="ProductBoxModel"/>.
 /// </returns>
 public static ProductBoxModel AsProductBoxModel(this IProductContent product)
 {
     return(BazaarContentHelper.GetProductBoxModel(product));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Clears the store root from the content helper when a qualifying delete occurs.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private static void ContentServiceOnDeleted(IContentService sender, DeleteEventArgs <IContent> e)
 {
     BazaarContentHelper.Reset(e.DeletedEntities.Select(x => x.ContentType));
 }
Exemplo n.º 4
0
        /// <summary>
        /// The product content factory on initializing.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private static void ProductContentFactoryOnInitializing(ProductContentFactory sender, VirtualContentEventArgs e)
        {
            var store = BazaarContentHelper.GetStoreRoot();

            e.Parent = store;
        }