Support » Plugin: RestroPress - Online Food Ordering System » Limit the number of selectable AddOns

  • Resolved botwan

    (@botwan)


    Hi, I would like to limit the number of selectable AddOns to a specific number. For example: I sell an Ice Cream box and the user can choose maximum 5 flavours from a list of more than 30 flavours. How can i limit the selectable choices to 5.

    Thank you very much for your help.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Kshirod Patel

    (@kshirod-patel)

    Hello,

    With the current version of RestroPress its can’t be achieved. In the future version we will definitely think about this and add this functionality.

    But if you want that on urgent basis then you can contact us at restropress@gmail.com

    Hi botwan
    i have your same problem .. how did you solve can you help me? thanks

    Thread Starter botwan

    (@botwan)

    @irasta
    I resolved adding a jQuery script directly in the Food Item post which I want to limit addons selection (obviuosly using text mode, NOT visual mode).

    This is the script:

    <script>
    jQuery('input[type=checkbox]').change(function(e){
       if (jQuery('input[type=checkbox]:checked').length > 3) {
            jQuery(this).prop('checked', false);
       }
    })
    </script>

    You just need to copy it and change the number 3 to the selection limit you need. I hope this can help someone else with my same problem, before an official feature update will be released.

    @botwan

    I’m having similar porblem you’re having but little different. Instead having Maximum, I need to at minimum of 2. I guess could still use your JS code change length > 3 to length < 2. May I know which file did you put this in?

    thanks

    Thread Starter botwan

    (@botwan)

    Add the code in the text of Food Item you want to limit addons selection, for example, insert it after the description of your food item. Use text mode, not visual mode.

    You don’t need to change any file.

    @botwan under PHP file or JavaScript ? may I see which site you did on? very interest of what you did.

    Appreciate it!

    @botwan so i was able to add your script it works like your script but I was still able to add to the cart even if they dont select min 2 or max 2. Have you figure this out?

    Thread Starter botwan

    (@botwan)

    @chao-hang-lu

    It is great you found the correct way to add my code. This is how i added my code (slightly different because i added alert and some exclusions):

    I think you should do a validation for minimum selection, but i didn’t try that before. Probably the solution can be found here or here.

    How can I send you a private message? Skype?

    • This reply was modified 2 years, 2 months ago by botwan.
    • This reply was modified 2 years, 2 months ago by botwan.

    @botwan my email is vietkid2014@gmail.com and Skype id is vietkid12@hotmail.com add me ill pm you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Limit the number of selectable AddOns’ is closed to new replies.