Removing and customizing fields on appointments-confirmation-wrapper div

I'm working on my website locally and would like to customize the div 'appointments-confirmation-wrapper' output so that I can remove some fields. I'd rather not just set a 'display:none' to the elements in question, if possible. This fieldset pops up after a user clicks on a date and time in the calendar, and includes the two buttons 'Please click here to confirm this appointment', and 'Cancel'. Any assistance you can provide is greatly appreciated.

  • Katya Tsihotska

    Hi Travis

    Hope you're having a wonderful day!

    To remove already existing default fields go to the Appointments -> Settings -> General -> Display page and turn off the fields those you'd like to remove from the confirmation.

    If you'd like to add your own custom fields, you can do this via Additional fields add-on. First of all, you'd need to go to the Appointments -> Settings -> Add-ons and active mentioned add-on. Then go to the Appointments -> Settings -> General -> Accessibility and scroll down a bit. There you'll see the "Additional Fields" section where you can add your own fields.

    If you have any additional questions please let us know, we always are happy to help.

    Kind regards,
    Katya

  • Travis

    Hi Katya!

    Thanks for the assistance and I hope you're having a good day.

    I appreciate the insight into this issue. However, I'm wondering if I can remove the 'Service Name' and 'Service Provider' fields from the message, which appear to be included by default. I've been trying to look through the code to see if there's a way I can do this programmatically but I can seem to find the right file/function.

  • Katya Tsihotska

    Hi again Travis

    Got it. Note, that it's not recommended to make any changes in the plugin's code, as all changes will be overridden with the plugin update. So, since this is dealing with more advanced coding topics, I'm going to ping our Second Level Support Team (code experts) to get their valuable feedback on this. They will check if there is any hook or filter that allows customizing the confirmation shortcode output. One of our SLS members will reply back here as soon as more information is available.

    Please keep in mind that our SLS Team deals with more complicated issues, thus it may take a little longer for them to reply here. Thank you for your patience while we look into this further.

    Kind regards,
    Katya

  • Ari

    Hi Travis

    Hope you are fine today!

    About removing 'Service Name' and 'Service Provider' fields from the message, I made a mu-plugin for you: https://gist.github.com/wpmudev-sls/10d72500494c5b5808b5288cddafc55e

    === To activate it: ===

    1: Please create a mu-plugins folder inside the wp-content folder if it's not exist.
    2: Download the above file, unzip it,.
    3: Then copy this "appointment-details-modify.php" file & upload in the mu-plugins folder.

    === What is mu-plugins? ===

    mu-plugins also called "must use plugins" is auto-activated plugin, that's mean by adding that file inside the "mu-plugins" the code is automatically start functioning without any activation from dashboard. If you need to more about mu-plugins, here's the link: https://codex.wordpress.org/Must_Use_Plugins

    In future if you need to deactivate it, just remove this file.

    Let me know if you have any problem regarding this issue.

    Have a great day!
    Cheers, Ari

  • Travis

    Thanks Ari!

    I followed the instructions as outlined in your email but was unable to see any results on the page. I cleared the cache and restarted my environment to double-check. I really appreciate you creating the MU-plugin for me but I'm wondering if there is another way to make this work?

    For my purposes, the 'Service' and 'Provider' fields will hold the same value for every appointment, making that information redundant. Is there a class that I can override in order filter out that information? Any way I can alter the output of the shortcodes that I am using?

    Thanks,

    Travis

  • Ari

    Hi Travis

    What I made is the right way! I have used a filter to change the output in the mu-plugin.

    I can tell you the file and necessary changes, but this is not the good way, since if you update the plugin these changes will get lost.

    Now sure why the mu-plugin is not working in your case, it was working for me, it removed the "Service" and "Provider" field. Can you please send me the FTP credentials & Site access to check why it's not working! Please send the credentials to our secure contact form: https://premium.wpmudev.org/contact/#i-have-a-different-question
    Using the below template:

    Subject: "Attn: Ari"
    - WordPress admin (login url/username/password)
    - FTP credentials (host/username/password)
    - cPanel/Plesk credentials (host/username/password)
    - link back to this thread for reference (it is: https://premium.wpmudev.org/forums/topic/removing-and-customizing-fields-on-appointments-confirmation-wrapper-div)

    Keep in mind the subject line as ensures that it gets assigned to me.

    ===

    But if you prefer to change the plugin files, here's the way:
    Open this file by FTP or cPanel: plugins/appointments/includes/shortcodes/class-app-shortcode-confirmation.php
    And remove the below code which is on line 148 & 149:

    <div class="appointments-confirmation-service"></div>
    <div class="appointments-confirmation-worker" style="display:none"></div>

    Like below image:

    Have a great day!
    Warm Regards,
    Ari

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.