I am successfully able to create an order and I am also creating an order detail for the order. In the admin I can see is only the Order and not the order details (screenshot attached). When I run the sql query to fetch the details i am able to see in the database that order details is created.
The code I am using is below. Please let me know what I am missing that is creating this issue. private static void CreateOrderDetail(Order order, Guid productId, string title, string sku, double weight, decimal total, decimal price, int quantity, int taxClassId, decimal taxRate, bool taxInPrice, decimal deltaPrice, decimal basePrice, bool isShippable, bool isOnSale) OrdersManager ordersManager = OrdersManager.GetManager(); if (order == null) return; // Order does not exist. //Create a new OrderDetail OrderDetail detail = ordersManager.CreateOrderDetail(); //Set properties. detail.BasePrice = basePrice; detail.CreatedDate = DateTime.Now; detail.DeltaPrice = deltaPrice; detail.IsOnSale = isOnSale; detail.IsShippable = isShippable; detail.Price = price; detail.ProductId = productId; detail.Quantity = quantity; detail.Sku = sku; // detail.TaxClassId = taxClassId; detail.TaxInPrice = taxInPrice; detail.TaxRate = taxRate; detail.Title = title; detail.Total = total; detail.Weight = weight; //Associate detail with order. detail.Parent = order; order.Details.Add(detail); ordersManager.SaveChanges();
Thanks a lot. It helps a lot.