Exemple #1
0
        public int CreateFromCart(int cartId, ShoppingContext context)
        {
            var service = new Kooboo.Commerce.Carts.ShoppingCartService(_context.Instance);
            var cart = service.Find(cartId);

            return _context.Database.Transactional(() =>
            {
                var orderService = new Kooboo.Commerce.Orders.OrderService(_context.Instance);
                var order = orderService.CreateFromCart(cart, new Kooboo.Commerce.Carts.ShoppingContext
                {
                    Culture = context.Culture,
                    CustomerId = context.CustomerId
                });

                return order.Id;
            });
        }
Exemple #2
0
        public int CreateFromCart(int cartId, ShoppingContext context)
        {
            var service = new Kooboo.Commerce.Carts.ShoppingCartService(_context.Instance);
            var cart    = service.Find(cartId);

            return(_context.Database.Transactional(() =>
            {
                var orderService = new Kooboo.Commerce.Orders.OrderService(_context.Instance);
                var order = orderService.CreateFromCart(cart, new Kooboo.Commerce.Carts.ShoppingContext
                {
                    Culture = context.Culture,
                    CustomerId = context.CustomerId
                });

                return order.Id;
            }));
        }