Additional fields add-on doesn't add fields to manual appointment creation.

I've found the add-on 'Additional fields' extremely useful for gathering more important information about users signing up for an appointment.

However, I noticed that this seems to only work for the front end and doesn't create fields in the section where I add appointments manually.

What would you recommend?

1. Developer to code in the additional fields so they would show in the front and admin area? - Is this even possible?

2. Forget about adding a new appointment in the admin area and just do it for the client from the front end? This is actually the only way currently to do it if you are going to want to add manually and charge the client while on the phone see here

Or is there another method?
Thanks

  • David
    • Design Lord, Child of Thor

    I should clarify that the fields are created in the appointment details after the information is added into the additional fields in the front end. However, if I have an additional field of say 'age' that field is not available to me to fill in when I go to create a manual appointment.

  • Patrick
    • Support Monkey

    Hi @David

    I just tested that and confirm that additional fields do not appear in the admin when creating manual appointments.

    That would be a nice enhancement to that addon.

    I'll move this to the Features & Feedback forum and notify the developer of the suggestion.

    Thanks!

  • Patrick
    • Support Monkey

    Hey there @Dan

    I hope you are well today!

    That's a good question.. I thought it would be in the app_appointments table with the other fields, but can't find the custom fields anywhere.

    I'll see if the developer or one of our 2nd-level support guys can drop in to shed some light on this. Hang on...

  • Dan
    • Flash Drive

    It looks as if this data is parsed as a parameter using AJAX when someone submits the form. So that data is never stored into the database and that might be why this data can't be edited or added manually.

    That's what it looks like to me, but I would like to hear the developers response and if they have any ideas on this.

    Thanks

  • David
    • Design Lord, Child of Thor

    I would really like this to be addressed. I know there is a beta version of Appointments on these forums which addressed a few other problems, do we have an ETA on when the full updated version will be released?

  • Wayne
    • The Incredible Code Injector

    @Ashok @Patrick Cohen

    Just to add to this one guys - I would also really like this additional fields to display for manual appointments made in the admin - it seems very strange that this is not actually the case and that the only way the data can be captured is via the front end.

    In addition when an appointment is made via the front end those fields are not editable in the admin, again I think they should be in case something changes and needs to be updated.

    @David Sorry to jump on the back of your ticket but I think we are both wanting the same thing so hope you don't mind me not creating a separate topic?

    Many Thanks

    Wayne

  • Ash
    • WordPress Hacker

    Hi @David and @Wayne

    I have just talked to the developer about this and he is working on it. So, maybe it will be added in next version :slight_smile:

    Unfortunately I can't give you any ETA for this, but at least this is coming :slight_smile:

    Cheers
    Ash

  • pxwm
    • WP Core Meltdown

    Hi@Ashok,

    You have my +1
    Would it be possible if you could also ask the developer if he could consider using the same error handling message for these additional fields as is the case with the standard fields so the message can be revised using the shortcode.

    Regards
    SteveB

  • Jose
    • Bruno Diaz

    @David @Dan @Wayne @pxwm,

    I added the requested feature to the Additional Fields add-on.

    You need to replace the add-on file with the one attached. It is located under the folder wp-content\plugins\appointments\includes\addons\

    @Dan, Regarding your question:

    Can you tell me where the Additional Fields are stored in the database?

    The additional fields are stored in the table {your-db-prefix}_options.
    You can see the stored data by running the following query:

    SELECT *
    FROM {your-db-prefix}_options
    WHERE {your-db-prefix}_options.option_name = 'appointments_data';

    Please let me know if this works as expected for you guys!

    Cheers,
    JJ

  • Wayne
    • The Incredible Code Injector

    Hi @Jose

    Ok - so I have installed this and nearly everything is working as it should except one thing. If you add an appointment manually from the admin area, on save it sends the send_confirmation email to the client.

    In this email the custom email fields are not translated though and the email comes out like this;

    Here Are The Appointment Details

    Kick Off Time: 9 June, 2014 9:00 pm
    Home Team: FIELD_HOMETEAM
    Away Team: FIELD_AWAYTEAM
    Age Group: FIELD_AGEGROUP
    Competition: FIELD_COMPETITION
    Location: FIELD_LOCATIONOFGROUND

    You will note the time field is fine but the custom fields I have created remain without converting the data. All subsequent emails such as confirmation of the appointment etc translate the fields no problem, it is just this very first email and only on manual appointments being added in the admin. If the client creates the booking from the front end again the fields all translate.

    On my site specifically please take note of the following topic where @Saurabh Shukla has done a fantastic job in getting my setup where it should be and as I don't feel that this is related to his changes and specifically related to this manual creation in the admin, I have added this response here instead of in the other topic as that is now working perfectly for me so please don't break that code.

    https://premium.wpmudev.org/forums/topic/ok-folks-so-here-is-my-current-process-vistor?replies=20#post-685401

    Support Access is granted should you need it and please feel free to test.

    Other than that it works brilliantly.

    Regards

    Wayne

  • Wayne
    • The Incredible Code Injector

    @Jose

    In addition can the layout be resolved in the admin - as you can see the custom fields don't display properly - perhaps a line break with the field titles above the field would make it better etc?

    Just a minor thing.

    Wayne

  • Jose
    • Bruno Diaz

    Hi again @Wayne,

    Unfortunately, I can't reproduce your issue. The email macros are being replaced just fine on my local environment. There might be some issue with hooks priority not taking place correctly in your environment for some reason. But those are set just fine, and working as expected on my end.
    Can you please run further tests over this to confirm?
    Also, I'll ask @Saurabh Shukla to test the code and try to reproduce the issue.

    Regarding the layout issue, you can add the following snippet to functions.php file in your theme:

    //Add custom CSS to admin section.
    add_action('admin_head', 'my_custom_fonts');

    function my_custom_fonts() {
        echo '<style>
        .inline-edit-row fieldset.inline-edit-col-left label span.input-text-wrap {
          margin-left: 8em;
        }
        .inline-edit-row fieldset.inline-edit-col-left label span.title{
           width: 8em;
        }
        .inline-edit-row fieldset.inline-edit-col-left label {
            clear: both;
        }*/
      </style>';
    }

    You can adjust the number according to your needs.

    Please keep me posted

    Thanks,
    JJ

  • Saurabh
    • New Recruit

    Hi @Wayne,

    Looks like you are right, indeed. The first time, these fields are saved, the emails aren't processed properly. This is because, the extra fields are getting saved after the email is already sent.

    We'll need to modify the functions, so that the fields are saved beforehand.

    We'll test this and attach the modified code here, as soon as we've fixed it.

    Best

    Saurabh

  • Saurabh
    • New Recruit

    Hi @Wayne,

    Hope you are doing well today!

    This is gotten to be a little tricky. It seems that the action where @Jose and I have been hooking into happens after the confirmation mails are sent.

    This is all fine for the modifications that I have been doing, because I don't modify the email, I only use it to send an additional email that was never going to be sent. However, for the modifications here, the additional fields are saved after the email has been sent. This is why they aren't getting replaced.

    We are going to see if we can modify and update the plugin a bit, so this becomes easier in the future. As of now, we'd need to edit the main appointments.php file to move the action just before the confirmation mails are sent.

    So, we'll rewrite the lines 8487-8491:

    do_action('app-appointment-inline_edit-after_save', ($update_result ? $app_id : $wpdb->insert_id), $data);
    
    if ($resend && 'removed' != $data['status']) {
    	$this->send_confirmation( $app_id );
    }

    to:

    if ($resend && 'removed' != $data['status']) {
    	$this->send_confirmation( $app_id );
    }
    
    do_action('app-appointment-inline_edit-after_save', ($update_result ? $app_id : $wpdb->insert_id), $data);

    In addition, we'll need to modify @Jose's code a bit. I have made the changes to your site and attached the modified file, here.

    Do let us know how this works out.

    Best

    Saurabh

  • Saurabh
    • New Recruit

    Hi Wayne,

    We're sure glad, we could be of help.

    These are some interesting features that we've ended up building for you. I hope some of these make their way into the plugin, soon.

    Thank you for that and your patience.

    Best

    Saurabh

  • Ash
    • WordPress Hacker

    Hello @Kieran

    I can't confirm right now if it can be included into next release, but I will definitely pass the message to the developer.

    So meantime, please use the code like this, if it is added the docs will be included in the changelog.

    Cheers
    Ash

  • Kieran
    • The Crimson Coder

    Hi Ash

    Thanks for the reply. I've just noticed the following message is displaying in my wordpress dashboard. Right at the bottom above "Thank you for creating with Wordpress". I'm fairly certain it's in relation to this php as I can see that line in the code

    // For each custom field, we need to get the value via JS and push it into the data sent into the ajax post call, // so that we can get it later in 'app-appointment-inline_edit-after_save' hook.

    Any idea how to fix.

    Cheers
    Kieran

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.