• Resolved dineintec

    (@dineintec)


    Hi, I am using this plugin for a restaurant (well it is actually a food court). There are 20 shared tables each seating 12 people. So I have set a minimum booking count to 2 and a maximum booking count to 240 to accommodate maximum capacity.

    Now not sure if I am missing something simple here, but I wish to limit an individual booking size to a maximum of 12 counts when the user selects their party size in the “Booking items count” field. This is to prevent a user booking more than one whole table or even booking the whole venue.

    Is there an option to achieve this, or are you able to provide a working snippet instead if the option is not present?

    Thanks,
    Paul

    • This topic was modified 1 year, 3 months ago by dineintec.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WebbaPlugins

    (@webba-agency)

    Hi Paul,

    I’ll be happy to help you.

    You can archive this using a custom JavaScript code. Example: https://github.com/ivanhala/webba_limit_places/blob/main/example.js

    In the code please replace const limit = 10; with the const limit = 12;

    If you have any questions, feel free to ask.

    Thread Starter dineintec

    (@dineintec)

    Thanks this works great! I also changed var i = 1 to var i = 2 so the drop down menu shows values from 2-12.

    If anyone is wondering how to implement this I used a HTML snippet using Code Snippets plugin and used the following code:

    <script>
    jQuery(document).on( 'wbk_on_form_rendered', function(){
        const limit = 12;
        jQuery('.wbk-book-quantity').find('option').remove();
        var options = '';
        for( var i = 2; i <= limit; i++ ){
          options += '<option value='+ i  + '>' + i + '</option>';
        }
        jQuery('.wbk-book-quantity').html(options)
    });
    </script>

    Then you just insert the generated short code into your page before the Weba shortcode.

    This makes it easier to keep your custom code when Webba or WordPress is updated!

    • This reply was modified 1 year, 3 months ago by dineintec.
    Plugin Author WebbaPlugins

    (@webba-agency)

    Thanks a lot for sharing your version of custom code!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Set a limit to booking count’ is closed to new replies.