appointment thank you page – customise

accessibility settings

appointment thank you page

Is it possible to retrieve the first name of the confirmation page to say “hello xxxxxxx” before the thank you text?

  • Kasia Swiderska
    • Support nomad

    Hello shelvene,

    It is not possible out of the box and I don’t see that we have any code snippet that would allow for that.

    Let me consult this with our Second Line Support developers and see if this would be possible with a quick code snippet.

    We will keep you posted.

    kind regards,

    Kasia

  • Ari
    • Recruit

    Hey shelvene

    hope you are well today!

    Yeah, it's possible by some custom coding, I just made a custom shortcode for you, please follow the below steps:

    === Installation ===

    Download this gist file: https://gist.github.com/wpmudev-sls/a6af5ec5132372d835019c1428b6be0e

    Upzip it, then upload this app-custom-thank-you-shortcode.php file to wp-content/mu-plugins folder, if mu-plugins folder not exist just create it.

    === Configuration ===

    Please edit the file you just uploaded with your custom message, you need to edit this portion of code:

    ===

    Let me know if that works for you!

    Best Regards,

    Ari

  • shelvene
    • Design Lord, Child of Thor
    <?php

    /**
    * Plugin Name: Appointment+ custom thank you shortcode with name
    * Plugin URI: https://premium.wpmudev.org/
    * Description: Appointment+ custom thank you shortcode with name
    * Author: Ariful Islam @ WPMUDEV
    * Author URI: https://premium.wpmudev.org/profile/itsarifulislam
    * License: GPLv2 or later
    */

    if ( ! defined( 'ABSPATH' ) ) {
    exit;
    }

    function app_custom_thank_you() {

    // get the current user data
    $user = wp_get_current_user();

    // define the name variable to store the name
    $name = null;

    // get the name if any user available
    if ( $user && $user->ID ) {
    $name = $user->display_name;
    }

    // if no user then try get the visitor name
    if ( empty($name) && class_exists('Appointments_Sessions') && !empty($data = Appointments_Sessions::get_visitor_personal_data()) ) {
    $name = $data['n'];
    }

    ob_start();

    if ( $name ) : ?> <!-- Message when $name is available -->

    <p><b>Bonjour <?php echo $name; ?></b></p>, <br />
    <p><b>Merci d'avoir pris ce RDV!</b></p>

    <?php else: ?> <!-- Message when $name is not available -->

    <p><b>Bonjour, </b></p> <br />
    <p></b>Merci d'avoir pris ce RDV!</b></p>

    <?php endif;

    return ob_get_clean();

    }

    add_shortcode( 'app-custom-thamk-you', 'app_custom_thank_you' );

  • Patrick Freitas
    • Staff

    Hi shelvene

    How are you today?

    Wouldn’t you mind, please, describe what you would like to do on the message, and we can help with the code?

    Might some screenshot would help too :slight_smile:

    However, I suggest you using some <span> or classes to help you inset additional CSS.

    <?php

    /**
    * Plugin Name: Appointment+ custom thank you shortcode with name
    * Plugin URI: https://premium.wpmudev.org/
    * Description: Appointment+ custom thank you shortcode with name
    * Author: Ariful Islam @ WPMUDEV
    * Author URI: https://premium.wpmudev.org/profile/itsarifulislam
    * License: GPLv2 or later
    */

    if ( ! defined( 'ABSPATH' ) ) {
    exit;
    }

    function app_custom_thank_you() {

    // get the current user data
    $user = wp_get_current_user();

    // define the name variable to store the name
    $name = null;

    // get the name if any user available
    if ( $user && $user->ID ) {
    $name = $user->display_name;
    }

    // if no user then try get the visitor name
    if ( empty($name) && class_exists('Appointments_Sessions') && !empty($data = Appointments_Sessions::get_visitor_personal_data()) ) {
    $name = $data['n'];
    }

    ob_start();

    if ( $name ) : ?> <!-- Message when $name is available -->
    <div class="custom-msg">
    <p><strong>Bonjour <span><?php echo $name; ?></span>,</strong></p>
    <p><b>Merci d'avoir pris ce RDV!</b></p>
    </div>
    <?php else: ?> <!-- Message when $name is not available -->
    <div class="custom-msg">
    <p><strong>Bonjour, </strong></p>
    <p></strong>Merci d'avoir pris ce RDV!</strong></p>
    </div>
    <?php endif;

    return ob_get_clean();

    }

    add_shortcode( 'app-custom-thamk-you', 'app_custom_thank_you' );

    Now you can control it using CSS on your WordPress Appearance > Customize > Additional CSS

    /** Add custom to the text **/
    .custom-msg p{
    // add your custom code
    }

    /** Add custom to the Name **/
    .custom-msg p span{
    // add your custom code
    }

    Let us know if you need any further help on this.

    Best Regards,

    Patrick Freitas

  • shelvene
    • Design Lord, Child of Thor

    Hi Patrick,

    Here the link to my thank you page

    Now I’ve:

    Bonjour Corinne ……., Merci d’avoir pris ce RDV!

    I would like to write it more nicely:

    in bold and with a line break

    Bonjour Corinne …….,

    Merci d’avoir pris ce RDV!

    The code above doesn’t work. I’ve a blank page.

    Kind Regards

    Shelvene

  • Patrick Freitas
    • Staff

    Hi shelvene

    Sorry to hear that it causes a Blank Page,

    I double checked the code and added a breaking line br, however, I had no problem on my end testing it if you changed only the if part.

    Check if you didn’t miss any code, or try to replace the entire code.

    Wouldn’t you mind please, update the code using the following?

    <?php

    /**
    * Plugin Name: Appointment+ custom thank you shortcode with name
    * Plugin URI: https://premium.wpmudev.org/
    * Description: Appointment+ custom thank you shortcode with name
    * Author: Ariful Islam @ WPMUDEV
    * Author URI: https://premium.wpmudev.org/profile/itsarifulislam
    * License: GPLv2 or later
    */

    if ( ! defined( 'ABSPATH' ) ) {
    exit;
    }

    function app_custom_thank_you() {

    // get the current user data
    $user = wp_get_current_user();

    // define the name variable to store the name
    $name = null;

    // get the name if any user available
    if ( $user && $user->ID ) {
    $name = $user->display_name;
    }

    // if no user then try get the visitor name
    if ( empty($name) && class_exists('Appointments_Sessions') && !empty($data = Appointments_Sessions::get_visitor_personal_data()) ) {
    $name = $data['n'];
    }

    ob_start();

    if ( $name ) : ?> <!-- Message when $name is available -->
    <div class="custom-msg">
    <p><strong>Bonjour <span><?php echo $name; ?></span>,</strong></p><br /> 
    <p><b>Merci d'avoir pris ce RDV!</b></p>
    </div>
    <?php else: ?> <!-- Message when $name is not available -->
    <div class="custom-msg">
    <p><strong>Bonjour, </strong></p>
    <p></strong>Merci d'avoir pris ce RDV!</strong></p>
    </div>
    <?php endif;

    return ob_get_clean();

    }

    add_shortcode( 'app-custom-thamk-you', 'app_custom_thank_you' );

    And on your custom CSS, WordPress Appearance > Customize > Additional CSS

    /** Add custom to the text **/
    .custom-msg p{
    color:#000;
    font-weight:bold;
    }

    /** Add custom to the Name **/
    .custom-msg p span{
    color:#000;
    font-weight:bold;
    }

    If this still not breaking line, is possible that another CSS is conflicting and not allowing the breaking line.

    Don’t forget to clean the caches, on WordPress/browser.

    Best Regards,

    Patrick Freitas

  • shelvene
    • Design Lord, Child of Thor

    Hello Patrick,

    Sorry, I always have a blank page.

    However, it works with the above coding.

    I’m not sure there’s a conflict because it would cause the same problem with the first coding

    Could you try directly on my site (grant access)?

    Thank you again for your help.

    Shelvène

  • shelvene
    • Design Lord, Child of Thor

    Hello Kasia,

    I’ve update to the latest version and the problem is still there.

    I don’t understand why the first custom shortcode you’ve made works well…

    thank you so much for making all these efforts

    Shelvene

  • Patrick Freitas
    • Staff

    Hi shelvene

    Sorry to hear that it still happening.

    Let me ask, are you replacing all code right?

    Wouldn’t you mind, please, send me some credentials, and I can take a closer look for you?

    Note: Don’t leave your login details in this ticket.

    Instead, you can send us your details using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question:

    Subject: “Attn: Patrick Freitas”

    – Site login URL:

    – WordPress admin username:

    – WordPress admin password:

    – FTP/SFTP credentials

    Host:

    Username:

    Password:

    Port:

    – cPanel credentials

    Host:

    Username:

    Password:

    – Folder path to the site in question:

    – Link back to this thread for reference

    – Any other relevant URLs/info:

    Please, reply to the ticket once you have sent the information.

    Best Regards

    Patrick Freitas

  • Patrick Freitas
    • Staff

    Hi shelvene

    How are you today?

    Thanks for the credentials.

    I was able to apply the code, seems you were using the new codes on a test.php file, it was causing a conflict once the function app_custom_thank_you() was already defined at 1app-custom-thank-you-shortcode.php, and I used the new code on 1app-custom-thank-you-shortcode.php to avoid the conflict.

    You can see the results on the screenshots.

    Logged in user:

    Not logged in

    You can edit colour, font.. at

    WordPress > Appaerance > Additional CSS.

    I added some codes to help you with this, you will see:

    /** Add custom to the text **/ and /** Add custom to the Name **/

    Let us know if you need any further help on this.

    Best Regards,

    Patrick Freitas

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.