• Resolved evo252

    (@evo252)


    Hi!

    I used this code to hide some locations from my dropdown menu reservation, but I notice that it’s not working on mobile, I don’t know why. Do you have any solution?

    Thanks a lot!

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support jaysupport

    (@jaysupport)

    Hi evo,

    Thanks for contacting us. Are you by any chance caching the mobile version of the webpage? If so, could you try clearing your cache and seeing it that makes a difference?

    Thread Starter evo252

    (@evo252)

    yes, I have already cleared the cache and I tried on private navigation also, but same problem

    Plugin Support jaysupport

    (@jaysupport)

    Hi evo,

    In that case, you might have to use JavaScript to target specific options in the dropdown and remove them, relative to the page ID. Normally custom code goes beyond the scope of support, but I’ve put together a quick example of something like what you might need to do:

    jQuery( document ).ready( function() {
    
      function removeLocationOptionByValue(valueToRemove) {
        jQuery( '#rtb-location ' + ' option[value="' + valueToRemove + '"]' ).remove();
      }
    
      //on page 'reservation' (id: 7258)
      if ( jQuery( 'body' ).hasClass( 'page-id-7258' ) ) {
    
        //Remove Libshop Boétie
        removeLocationOptionByValue( 37 );
    
        //Remove Libshop Libshop Victoire
        removeLocationOptionByValue( 36 );
      };
    });

    You can place JavaScript in a JavaScript file in your child theme or you can use a plugin like Header and Footer Scripts (https://www.ads-software.com/plugins/header-and-footer-scripts/) and place it in the footer scripts box.

    Thread Starter evo252

    (@evo252)

    Thanks a lof for your help!

    I have addeed this code via this plugin, but it didn’t change anything.

    I also tried to change “37” and “36” values by 7389 and 7390 (the ID of the two locations I want to hide, I saw these ID when I click on “edit location” in the URL bar), but It’s not working ?

    Plugin Support jaysupport

    (@jaysupport)

    Hi evo,

    Perhaps the page ID in the condition is not correct then?

    Are you able to create location-specific booking pages? You can use the location attribute in the [booking-form] shortcode to resolve this issue. More information here: https://doc.fivestarplugins.com/plugins/restaurant-reservations/user/blocks-shortcodes/booking-form-shortcode

    Normally custom code goes beyond the scope of support

    Unfortunately we cannot help with custom coding. The provided JavaScript is the gist of what you would need to do to enable it to function similarly to how you wanted. It is provided with the understanding that some coding experience is required It is untested and not something we can help to further customize.

    • This reply was modified 10 months, 3 weeks ago by jaysupport.
    Thread Starter evo252

    (@evo252)

    Hi,

    I have exactly added the snippet code, and I took the ID from the URL bar from edit location page, is it correct like that?

    I don’t have any other solution, as I don’t want my customer book for 2 of my locations because there is no possible booking for this two restaurants, but it’s possible for the 2 other ones…

    Is there maybe another solution? Maybe an future update that let us choose which restaurants we want to provide in the booking page for multilocations?

    Thanks a lot!

    Plugin Support jaysupport

    (@jaysupport)

    The only way to do something similar to what you want is the multiple booking form solution or to write your own JavaScript function.

    Thread Starter evo252

    (@evo252)

    I am already using the multiple booking form solution? I need to hide 2 of the 4 locations on the dropdown list from this multiple booking form, but the problem is that it’s not working on smartphone, only on web version?

    I can also use the booking-form shortcode for each restaurant but if would be bery great if we can choose which restaurants we want to show or hide on the global booking page.

    Plugin Support jaysupport

    (@jaysupport)

    Is it the libshop 8 and 9 that you want to hide? Because they don’t show in the dropdown when I view your page.

    Thread Starter evo252

    (@evo252)

    Oh sorry now it’s working fine both on desktop and smartphone! It was because of the Id of the restaurant, sorry but where did you find “37” and “36” for these two restaurants?

    The mistake that I did is that I took the ID from the edit location page, from the URL toolbar. Where did you find the correct ID?

    Thank you so much!!!

    • This reply was modified 10 months, 2 weeks ago by evo252.
    Plugin Support jaysupport

    (@jaysupport)

    Just went to your booking page, right clicked on the select box and inspected element. Shows the code for the options in the browser console, including the ID of the location.

    • This reply was modified 10 months, 2 weeks ago by jaysupport.
    Thread Starter evo252

    (@evo252)

    Thank you so much!!!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Hide specific restaurant locations in the location dropdown’ is closed to new replies.