[app_my_appointments] colspan issue


re: appointments+

For [app_my_appointments] shortcode, when there are no appointments to display, the table td outputs <td colspan="4">No appointments</td> instead of colspan=5. How can this be fixed?

I'm using these parameters - [app_my_appointments allow_cancel="1" title="<h3>Appointment Confirmation</h3>" gcal="0"] and I have the location add-ons enabled.

  • Vaughan
    • Support/SLS MockingJay

    Hi Duane,

    Hope you're well?

    I can confirm this on my own site too. I have reported this as a bug to the developer, hopefully we can get this fixed quickly.

    To fix yourself, open up & edit /wp-content/plugins/appointments/includes/shortcodes/class-app-shortcode-my-appointments.php

    Find the following on or around line 156;

    if ( $allow_cancel && !$provider && isset( $appointments->options['allow_cancel'] ) && 'yes' == $appointments->options['allow_cancel'] )

    Replace with;

    if ( $allow_cancel || !$provider && isset( $appointments->options['allow_cancel'] ) && 'yes' == $appointments->options['allow_cancel'] )

    Hope this helps

  • cardwellcreate
    • Design Lord, Child of Thor

    Thanks for investigating.

    I tried the fix. The colspan got corrected, but now the Cancel column is appearing when it should be hidden per the parameter setting allow_cancel="1".

    I'll try jquery to fix the front end until your dev team releases an upgrade. Thanks!

  • Vaughan
    • Support/SLS MockingJay


    Ok, try this instead.

    Remove the changes I posted above.

    Now find the following on or around line 192

    $ret .= '</thead><tbody>';

    Add the following line before it, so that it looks like below

    $colspan = substr_count($ret, '<th class="my-appointments-');
    		$ret .= '</thead><tbody>';

    This should then work fine. Instead of us using $colspan++,we're justinstead counting the number of occurences of the th instead,so the colspanwill automatically adjust & take into consideration add-ons such as the location.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.