Return all orders with Commerce
# help-with-umbraco
t
Hi 1. I would like to retrieve a list of orders between date 1 and date 2 in a Json (or maybe another format) is this possible if using Umbraco Commerce? 2. When an order is placed, I would like to copy the order to our internal system. How could I intercept when an order is placed to do this (so the existing workflow doesn't break when placing an order) 3. The store would be selling clothing items, how could I differentiate between male items and female items? Inline with that I may want to further separate the products between female items but may not want to show each gender inappropriate products as they may not be relevant. 4. Does the system support third party logins so I don't need to use Umbraco members for registered users to place an order? Thank you
r
1. IOrderService can be used to get all orders. The below code can be modified to filter on date. var orders = _orderService.SearchOrders((where) => where .FromStore(storeId.Value) .And(where.HasOrderNumber("order-",StringComparisonType.StartsWith))); 2. We created a custom template for "Order confirmation" step. Here we send the order to our internal system. var store = Model.GetStore(); var order = UmbracoCommerceApi.Instance.GetCurrentFinalizedOrder(store.Id); if (order != null && order.Properties["InternalOrderNumber"] == null) { await _bcService?.SendSalesOrderAsync(order); }
44 Views