Example #1
0
        /// <summary>
        /// Maps <see cref="IItemCacheLineItem"/> to <see cref="BasketItem"/>.
        /// </summary>
        /// <param name="item">
        /// The item.
        /// </param>
        /// <param name="merchello">
        /// The <see cref="MerchelloHelper"/>.
        /// </param>
        /// <returns>
        /// The <see cref="BasketItem"/>.
        /// </returns>
        public static BasketItem AsBasketItem(this ILineItem item, MerchelloHelper merchello)
        {
            var product = merchello.TypedProductContent(item.ExtendedData.GetProductKey());

            var productItem = item.AsProductLineItem(merchello);

            var basketItem = AutoMapper.Mapper.Map <BasketItem>(productItem);

            basketItem.ProductKey = product.Key;
            basketItem.ProductUrl = product.Url;

            return(basketItem);
        }