Appointments + : add a Cancel and Modify link

Hello WPMUDEV Team !

I have one question separated in two !

- How can I replace the Cancel checkbox by a simple link ?
Because I added it to my table, but when I check the box nothing happens. A link will be really much better
- Is there a way to add a Modify link ? This link will bring you to the Appointment Schedule page with you open Appointment and gives you the ability to modify the date and / or the time, then click on confirm to put the Appointment to Pending.

I don't think the second option is yet possible, if not you can put it in Ideas for next updates :wink:

Regards,
Guillaume

  • Adam Czajczyk

    Hey Guigro,

    I hope you're well today and thank you for your question!

    - How can I replace the Cancel checkbox by a simple link ?
    Because I added it to my table, but when I check the box nothing happens. A link will be really much better

    I must admit I'm not quite sure what are you asking for. Could you please:

    - point me to the page in question
    - elaborate a bit on how did you setup your page/this particular page/Appointments+ plugin?

    This would help a lot!

    As for the "modyfiy/cancel". Users are able to cancel their appointments by clicking the link in an e-mail notification. There's no "edit" link but user should be able to cancel the appointment and then book a new one.

    I hope that helps!

    Cheers,
    Adam

  • Guigro

    Hello Adam !

    Sorry for the lack of information I gave you, I wrote this a little bit too fast !

    I can't really send you a link to the page as it's My Account page if you already went through the whole registration process.
    Here is how it works :
    > Customers go through the registration process, at the end they are asked to book an appointment.
    > Later (like in one month or so), they will still be able to ask for an appointment.
    > On their "My Account" page, I added the shortcode "My Appointment" to let them see their appointment and checked if it's Pending, Accepted, Canceled, Terminated, ...
    > I want to give them the ability to Cancel their appointment. So I added the "allow_cancel" to the shortcode (and I set to YES in settings the ability to customers to cancel their own appointments).
    > Once I added this, I get a new column in my "My Appointments" table with a Checkbox. All I can do is check it, but nothing happens. I would rather have a link named "Cancel" that will cancel the appointment if clicked and bring back to the "Take an appointment page" or put a notice (like a pop up or so) to validate the cancellation.

    I add a screenshot of my table, sorry it's in French.

    Thanks a lot !
    Regards,
    Guillaume

  • Predrag Dubajic

    Hi Guillaume,

    Changing the checkboxes to links would require changes within the plugin files and it will get overwritten by the plugin update.
    I would suggest checking out why the boxes are not working for you first, it should show popup screen when you click on the box, as shown on screenshot attached below.

    If you could grant support access I would be happy to have a look at this and check why it's not working for you.
    To enable support access you can follow this guide here:
    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Guillaume,

    How was your accounts page created, I only see [woocommerce_my_account] shortcode which is used to add content to that page, I and since the site is French I'm having troubles finding out where to edit that and check the content of that shortcode, is that shortcode something that you created in theme functions or using some plugin?

    When I add [app_my_appointments allow_cancel = "1"] at the end of that same page, cancelation is working fine.

    Best regards,
    Predrag

  • Guigro

    Hi Predrag,

    To build my "My Account" page (sorry for the French version of it), I have in my theme files that are called to be included in this page.
    The whole code for the Appointment table is :

    echo do_shortcode('[vc_column_text el_class="wpb_content_element  large-12 large-centered"]
    <h2>Mes Rendez-vous</h2>
    [app_my_appointments status="paid,confirmed,pending,completed,reserved" title="" allow_cancel="1"]
    [/vc_column_text]
    [vc_btn title="Accéder à ma sélection en cours" style="flat" shape="square" color="orange" size="md" align="center" i_align="left" i_type="fontawesome" i_icon_fontawesome="fa fa-adjust" i_icon_openiconic="vc-oi vc-oi-dial" i_icon_typicons="typcn typcn-adjust-brightness" i_icon_entypo="entypo-icon entypo-icon-note" i_icon_linecons="vc_li vc_li-heart" link="url:http%3A%2F%2Fsommelierparticulier.com%2Fpanier%2F||" button_block="" add_icon="" i_icon_pixelicons="vc_pixel_icon vc_pixel_icon-alert"]');

    Weird situation, I really don't understand what blocks it :disappointed:

  • Predrag Dubajic

    Hey @Guigro,

    Thanks a lot for the explanation, I believe we got this now :slight_smile:

    In your file which has those shortcodes try adding this line of code somewhere at the beginning of the file or above the echo do_shortcode(... part:
    <?php global $appointments; $appointments->load_scripts_styles(); ?>

    Please let me know if it's working after that :slight_smile:

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Guillaume,

    Apologies for the delayed answer here, I was away for few days.

    Sorry to hear that didn't work, not sure why though, and if you could provide me with FTP access I would be happy to have a closer look at this.

    You can send us your details using our contact form https://premium.wpmudev.org/contact/ and the template below:

    IMPORTANT: Make sure you select "I have a different question" for your topic so it doesn't go back to forums - this and the subject line ensure that it gets assigned to me.

    Subject: "Attn: Predrag Dubajic"
    - WordPress admin username
    - WordPress admin password
    - login url
    - FTP credentials (host/username/password)
    - List of your custom files I should look at
    - link back to this thread for reference
    - any other relevant urls

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Guillaume,

    I have modified my-appointments.php to add the line mentioned few tickets above it it's working now for me.
    This is how the file looks now:

    <?php
    /**
     * My Orders
     *
     * Shows recent orders on the account page
     *
     * @author 		WooThemes
     * @package 	WooCommerce/Templates
     * @version     2.2.0
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
        exit;
    }
    global $appointments; $appointments->load_scripts_styles();
    echo do_shortcode('[vc_column_text el_class="wpb_content_element  large-12 large-centered"]<h2>Mes Rendez-vous</h2>[app_my_appointments status="paid,confirmed,pending,completed,reserved" title="" allow_cancel="1"][/vc_column_text][vc_btn title="Accéder à ma sélection en cours" style="flat" shape="square" color="orange" size="md" align="center" i_align="left" i_type="fontawesome" i_icon_fontawesome="fa fa-adjust" i_icon_openiconic="vc-oi vc-oi-dial" i_icon_typicons="typcn typcn-adjust-brightness" i_icon_entypo="entypo-icon entypo-icon-note" i_icon_linecons="vc_li vc_li-heart" link="url:http%3A%2F%2Fsommelierparticulier.com%2Fpanier%2F||" button_block="" add_icon="" i_icon_pixelicons="vc_pixel_icon vc_pixel_icon-alert"]');
    
    ?>
    
    <style>
    .amount
    {
    display: none !important;
    }
    </style>

    Can you please test and confirm that it's working for you as well?

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.