How to change CSV Export Fields in Appointments +

Hi there,

I'm wanting to cut out a lot of the fields that are exported from Appointments Plus when doing an Excel/CSV export. E.g. I just want to export Name, Email, Phone and Appointment Start time.

What file would I edit to make this possible?

Cheers,
Sam

  • aristath

    Hello there @Sam and welcome to the WPMUDEV Community!

    From what I can tell you can use the 'app-export-columns' filter from the plugin and write your own custom function to hook into it, but to be honest that's a little above my level of expertise.
    I have notified one of our developers on this one, hopefully their insights will help us figure this one out.

    Please keep in mind though that plugin developers have a lot of responsibilities so this could take a bit longer than a normal ticket.

    Cheers,
    Ari.

  • Rahul Verma

    Hello Sam,

    Sorry for extremely delay here.

    You need to do following changes in /wp-content/plugins/appointments/appointments.php on line 7670

    Before :

    if ($ids) $sql = "SELECT * FROM {$this->app_table} WHERE ID IN(" . join(',', $ids) . ") ORDER BY ID";
    } else if ('type' == $type) {
    $status = !empty($_POST['status']) ? $_POST['status'] : false;
    if ('active' === $status) $sql = $this->db->prepare("SELECT * FROM {$this->app_table} WHERE status IN('confirmed','paid') ORDER BY ID", $status);
    else if ($status) $sql = $this->db->prepare("SELECT * FROM {$this->app_table} WHERE status=%s ORDER BY ID", $status);
    } else if ('all' == $type) {
    $sql = "SELECT * FROM {$this->app_table} ORDER BY ID";

    After :

    if ($ids) $sql = "SELECT name,email,phone,start FROM {$this->app_table} WHERE ID IN(" . join(',', $ids) . ") ORDER BY ID";
    } else if ('type' == $type) {
    $status = !empty($_POST['status']) ? $_POST['status'] : false;
    if ('active' === $status) $sql = $this->db->prepare("SELECT name,email,phone,start FROM {$this->app_table} WHERE status IN('confirmed','paid') ORDER BY ID", $status);
    else if ($status) $sql = $this->db->prepare("SELECT name,email,phone,start FROM {$this->app_table} WHERE status=%s ORDER BY ID", $status);
    } else if ('all' == $type) {
    $sql = "SELECT name,email,phone,start FROM {$this->app_table} ORDER BY ID";

    I have included field name in the query which you needed though you can change field name if you want to export more.

    I hope that helps. Please feel free to ask if you have more questions on the same.

    Best Regards
    Sandeep Kumar

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.