"Select input" blank for autorefresh

Hi there,

I have a small problem, in order to make the autorefresh="1" works, I need to have the select input blank. Indeed, one option is already selected and if I click on it, other options are not refreshing.

Thanks a lot!

Pierre

  • Bojan Radonic

    Hey there Pierre,

    Hope you're well today :slight_smile:

    I understand what you mean but in case you're having one provider per service this is default behavior of the plugin regardless of use of autorefresh. In this scenario plugin automatically selects the only available option (example: if you select "service1" that only has "Pierre" a provider once service is selected and the page is refreshed, provider will automatically select "Pierre" as this is the only available option, if there are multiple providers for that service once service is selected and page is refreshed first option will be automatically selected which would in case of multiple providers be "No Preference").

    It pretty much works the same other way around so if you select provider first, if that provider works on one service, that service will be selected, if he works on multiple services first option will be selected. This is needed due to the way plugin is designed so a calendar can be rendered once page refreshes if that makes sense.

    Hope this makes sense :slight_smile:

    Best regards,
    Bojan

  • Bojan Radonic

    Hey again Pierre,

    Thanks for access and explanation. I've done some testing on both your site and my sandbox site since I didn't really test this before (having so much space between each selection). Looks like only provider selection is actually targeting an element on page refresh so in order to have this working on each shortcode so it lands on the next one this would probably need to be custom coded.

    I've discussed this with our developer and he told me this wouldn't be an easy task in the current version of the plugin and that we will consider including something like this in the future.

    So in order to make this more visible you'll either have to reduce the featured image on that page and/or reduce the height of each element block so others are more visible initially or you could use default page calendar and try to tweak that a bit to look better.

    Also, if you need to customize this specific functionality you can post a job in our Jobs & Pros board where you can hire a developer to assist further: https://premium.wpmudev.org/wpmu-jobs/.

    Best regards,
    Bojan

  • Thibault

    Hi Bojan,

    Thanks again for your answer.
    I made the changes on the website. It's not optimal but better...

    I really would appreciate that the form would be clearer / fluider (thanks for asking your developper team!). Why is only the location provider normally working? Isn't that weird?

    Another thing, when following the steps 1, 2, 3 & 4, the details checking doesn't display the location.

    Please, find my code below.

    Thanks again!

    <table>
    <tbody>
    <tr>
    <td class="provider_locations_block">[app_provider_locations select="#1 Choisissez un lieu" show="VALIDER VOTRE LIEU"]</td>
    </tr>
    <tr>
    <td class="service_providers_block">[app_service_providers select="#2 Choisissez votre barbier" show="VALIDER VOTRE BARBIER"]</td>
    </tr>
    <tr>
    <td class="services_block">[app_services select="#3 Choisissez votre service" show="VALIDER VOTRE SERVICE"]</td>
    </tr>
    <tr>
    <td class="monthly_schedule_block" colspan="2">
    <div class="monthly_schedule_title">#4 Choisissez votre date</div>
    [app_monthly_schedule]</td>
    </tr>
    <tr>
    <td class="schedule_pagination" colspan="2">[app_pagination week="1"]</td>
    </tr>
    <tr>
    <td class="schedule_login" colspan="2">[app_login]</td>
    </tr>
    <tr>
    <td class="calendar_confirmation" colspan="2">[app_confirmation]</td>
    </tr>
    </tbody>
    </table>

  • Bojan Radonic

    Hey again Pierre,

    I really would appreciate that the form would be clearer / fluider (thanks for asking your developper team!). Why is only the location provider normally working? Isn't that weird?

    Actually only provider shortcode does that once service is already selected so it drops on calendar on page reload so it's not specifically related to Location shortcode. Also the way the plugin is designed this is not meant to be on separate page blocks as you've created it but rather in the same line which explains the lack of that specific functionality. As I already mentioned we're likely to have some changes for the front end in the future so they might include this as well :slight_smile:

    As for location not being included in the confirmation box that would have to be custom coded. I've found an older thread where this was custom coded by one of our devs but since the files have been changed I'll have to ask Ash for some feedback on this one so we can see if this can be implemented in the new version of the plugin.

    Best regards,
    Bojan

  • Bojan Radonic

    Hey again,

    A quick follow up since our ninja dev Ash made few adjustments in order to add worker location to confirmation box.

    Since there are no hooks that could be used for this you'll have to edit plugin core files, this means each time you update the plugin these changes will be lost. I'll mention this to our dev so we might add this to the plugin in the future as well.

    In order to do this you'll have to make changes in 3 plugin files:

    1. /wp-content/plugins/appointments/includes/class-app-ajax.php, add the following to line No 894:

    if( class_exists( 'App_Locations_WorkerLocations' ) ) {
                        $key = App_Locations_WorkerLocations::STORAGE_PREFIX . $worker;
                        $location_id = get_option( $key );
    
                        $loc_obj = App_Locations_Model::get_instance();
                        $worker_location = $loc_obj->find_by( 'id', $location_id );
                        $worker_location = $worker_location->get_display_markup( true, $location_id, $worker_location );
                    }

    on line 908 add the following:

    $worker_location = !empty($worker_location)
                ? '<label><span>' . __('Location: ', 'appointments' ) . '</span>'. apply_filters('app_confirmation_worker_locs', stripslashes( $worker_location )) . '</label>'
                : ''
            ;

    on line 952 add the following:

    'worker_location' => $worker_location,

    2. /wp-content/plugins/appointments/includes/shortcodes/js/app-confirmation.js

    On line no 71, add this in a new line:

    $('.appointments-confirmation-worker-loc').html(response.worker_location).show();

    3. /wp-content/plugins/appointments/includes/shortcodes/class-app-shortcode-confirmation.php

    On line no 138, add this in a new line:

    <div class=&quot;appointments-confirmation-worker-loc&quot; style=&quot;display:none&quot;></div>

    This should be the result

    Hope this helps :slight_smile:

    Cheers,
    Bojan

  • Thibault

    Hi Bojan!

    Thanks a lot for these two answer, and thanks Ash!
    Really appreciate your concern.

    About point #1 "dropping on calendar on page reload", I really hope I'll be able to enjoy this kind of feature in the future. Thanks for your help.

    And about point #2 "location not being included in the confirmation box", thanks for your custom code. The trick does work but I'll not be able to continally edit these files in the future - as some rookies will be in charge of managing the website after me. Do you think these changes may be part of a future plugin update? :slight_smile:

    Thanks again to both of you.

    Pierre

  • Bojan Radonic

    Hey Pierre,

    Unfortunately this wasn't added in the latest version. As I've mentioned above I've suggested this to our development team and it's likely that it is going to be added in the future considered that this has been asked few times before but I don't have the ETA on when or if will this be added to the plugin.

    What usually happens is that we move threads to features and feedback section on the forum for voting and then based on that we consider adding features to plugins but since I've found that this one had few requests already I've passed this to our developers.

    Best regards,
    Bojan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.