9th marketing segment now counts from actual Orders table instead of User.totalOrders counter
- The 'All Customers Who Ordered' segment was not appearing because:
- 1. It relied on User.totalOrders >= 1, but that counter was never backfilled for existing customers
- 2. It required acceptsEmailMarketing: true, filtering out most buyers
- Fix: Query distinct userIds from the Order table where status is PAID/IN_PRODUCTION/SHIPPED/DELIVERED/REFUNDED.
- Also removed the count > 0 condition so the segment always appears in the list.
e2fffa8View on GitHub →