コード例 #1
0
        internal static Cart Cart2()
        {
            Cart cart = new Cart();

            //Add Book
            Category category = CategoryHelper.GetBookCategory();

            cart.AddItem(new CartItem(ProductHelper.GetProduct("Gündeste", ProductTypeEnum.ProductPrice50, category), 2));
            cart.AddItem(new CartItem(ProductHelper.GetProduct("Atlas Vazgeçti", ProductTypeEnum.ProductPrice10, category), 2));
            cart.AddItem(new CartItem(ProductHelper.GetProduct("Semerkant", ProductTypeEnum.ProductPrice10, category), 1));

            //Add DVD
            category = CategoryHelper.GetDVDCategory();
            cart.AddItem(new CartItem(ProductHelper.GetProduct("Ahlat Ağacı", ProductTypeEnum.ProductPrice50, category), 1));
            cart.AddItem(new CartItem(ProductHelper.GetProduct("Kader", ProductTypeEnum.ProductPrice50, category), 1));

            cart.ApplyCoupon(CouponHelper.GetCoupon(CouponTypeEnum.RateCoupon10For150));
            return(cart);
        }