Update # of orders filter for orders with coupon

MAILPOET-5373
This commit is contained in:
John Oleksowicz
2023-12-06 11:07:55 -06:00
committed by Aschepikov
parent 09a5a5cbbc
commit dda7da465f
2 changed files with 75 additions and 6 deletions

View File

@ -78,6 +78,12 @@ class WooCommerceNumberOfOrders implements Filter {
$joinCondition
);
$action = $filterData->getAction();
if ($action === self::ACTION_NUMBER_OF_ORDERS_WITH_COUPON) {
$subQuery->innerJoin('orderStats', $wpdb->prefix . 'wc_order_coupon_lookup', 'couponLookup', 'orderStats.order_id = couponLookup.order_id');
}
$queryBuilder->add('join', [
$subscribersTable => [
/**