Handle previous orders without coffees assigned
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
cd14c04689
commit
6f3069bee9
@ -152,6 +152,7 @@ function action_wcs_renewal_order_created($order, $subscription)
|
||||
$order_coffees = [];
|
||||
$seen_subscriptions = [];
|
||||
|
||||
if ($last_order_coffees !== false) {
|
||||
// Get the latest coffee seen in each coffee list from the previous order
|
||||
foreach (array_reverse($last_order_coffees) as $last_order_coffee) {
|
||||
if (
|
||||
@ -174,6 +175,7 @@ function action_wcs_renewal_order_created($order, $subscription)
|
||||
$last_order_coffee["coffee_list"]->ID
|
||||
] = $position_in_list;
|
||||
}
|
||||
}
|
||||
|
||||
// Process coffee items based on the coffees in the last order
|
||||
process_coffee_items($last_order, $order_coffees, $seen_subscriptions);
|
||||
|
Loading…
Reference in New Issue
Block a user