Posted on 24/09/2024 11:53:33
I looked in the source code and it seems it's set by RecurringOrdersScheduledTaskAddIn, the scheduled task that creates recurring orders:
foreach (RecurringOrder recurring in RecurringOrder.GetRecurringOrdersForScheduling())
{
try
{
Order order = Ecommerce.Services.Orders.GetById(recurring.BaseOrderId);
if (order is object)
{
//Logger.LogGeneral("Recurring Order", "Creating recurring order based on orderID: " + order.Id) 'TODO: Fix logging in general
OrderManager oManager = OrderManager.GetFor(order);
oManager.Recurring();
recurring.LastDelivery = recurring.NextDelivery;
recurring.Save();
//Logger.LogGeneral("Recurring Order", String.Format("Recurring order process succeeded for order with orderID: {0}. Delivery date is {1}, next delivery {2}", order.Id, recurring.LastDelivery, recurring.NextDelivery)) 'TODO: Fix logging in general
}
else
{
//Logger.LogGeneral("Recurring Order", String.Format("Creating recurring order based on orderID: {0} is failed - order was deleted.", recurring.BaseOrderID)) 'TODO: Fix logging in general
result = false;
}
}
It's also used to calculate the next and future delivery dates inside RecurringOrder which are then shown in the UI for a recurring order:
So yes, it seems it's being used to determine when the next order is placed, based on that date and the recurence frequency and unit (i.e. ever 7 days, 1 month and so on).
Imar