Example #1
0
        public double?GetOrderTotalPrice(List <Item> orderedItemList, int paymentMethodId, int deliveryTypeId)
        {
            double?totalPrice = 0;

            foreach (var item in orderedItemList)
            {
                double?itemPrice = item.Quantity * item.Product.Price;
                totalPrice += itemPrice;
            }
            ;

            totalPrice += _paymentMethodService.GetCost(paymentMethodId);
            totalPrice += _deliveryTypeService.GetCost(deliveryTypeId);

            return(totalPrice);
        }