I’m using WP All Export to generate a CSV of trip bookings, but I’m running into two major issues. Hoping someone can help me figure out the best approach!
1ï¸âƒ£ Issue: Balance Payments Are Showing as Separate Rows Instead of Columns
• Each order has two payments:
• A deposit (initial payment).
• A balance (remaining amount to be paid).
• Right now, WP All Export is treating these as separate rows, instead of merging them into one row with separate columns.
Current Output (Incorrect)
12345 | John Doe | £500 | -
12345 | John Doe | - | £1,500
What I Need Instead (Correct Format)
12345 | John Doe | £500 | £1,500
One of my many code examples:
function balance_test($order_status, $deposit_balance) {
if (trim($order_status) == "wc-pending") {
// Ensure the balance is treated as a single value, even if multiple exist
$balances = explode("|", $deposit_balance);
// Remove duplicate and empty values
$unique_balances = array_unique(array_filter($balances));
// Return only the first unique balance as a single value
return !empty($unique_balances) ? array_values($unique_balances)[0] : "";
}
return "";
}
✅ I have tried using custom PHP functions to filter the Deposit Balance field, but it still merges multiple values (value1|value1). ✅ I checked for settings like “Merge Multiple Valuesâ€, but I don’t see a way to group balance payments correctly.
2ï¸âƒ£ Issue: Parent Orders Can Contain Multiple Attendees, Which Need to Be on Separate Rows: • Some bookings have multiple attendees under one order. • Right now, WP All Export keeps all attendees in a single row instead of listing them separately.
Current Output (Incorrect)
67890 | Jane Smith | 2 | Jane Smith, Mike Smith
What I Need Instead (Correct Format)
67890 | Jane Smith | 2 | Jane Smith
67890 | Jane Smith | 2 | Mike Smith
I tried enabling “Display Each Product in Its Own Rowâ€, but it didn’t split attendees into separate rows. Is there a way to split a comma-separated list of attendees into multiple rows dynamically?
What I Need Help With
1. How can I merge deposit & balance payments into a single row instead of separate rows?
2. How can I ensure multiple attendees from a single order appear as separate rows?
This data is being used for customer payments and trip attendance records, so it’s important that it’s structured correctly.
If anyone has insights on the right WP All Export settings, custom functions, or a workaround, I’d really appreciate it! 🚀
Thanks in advance!