• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


25 Feb, 2025

Updated at 16 Mar, 2025

WP All Export - Help Needed: Merge Balance Payments & Separate Attendees into Rows

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)

Order ID | Customer Name | Deposit Paid | Balance Due

12345 | John Doe | £500 | -
12345 | John Doe | - | £1,500

What I Need Instead (Correct Format)

Order ID | Customer Name | Deposit Paid | Balance Due

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)

Order ID | Customer Name | No. of Attendees | Attendee Name

67890 | Jane Smith | 2 | Jane Smith, Mike Smith

What I Need Instead (Correct Format)

Order ID | Customer Name | No. of Attendees | Attendee Name

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!