Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #3592959
Amount of choices left
Open

Comments

  • Tom started the conversation

    Hi,

    Is it possible to show the amount of choices left? Settings are for example max 7 choices and when there are 3 selected is shows "Only 4 choices left".

  •  767
    Janilyn replied

    Hi Tom,

    Thanks for contacting us here.

    We do not have this feature available in our plugin at the moment. 

    If you would like to request that, I will assign one of our developers to help you. Our developoer will reach back to you within 48 hours to help you out.

    Best regards.

    Janilyn T. - WPClever Support Agent

  • Tom replied

    Yes, I'd like to request this feature.

  •  1,224
    Dustin replied

    Hi Tom,

    You can use a regular snippet to display the selected items https://app.screencast.com/Chfx1CoTKwANV. The buyer will understand whether it is above or below the maximum value and adjust their choices accordingly.

    Please add the custom code below. (How do you add a custom code?):

    add_action( 'wp_footer', function () {
        ?>
        <script type="text/javascript">
          (function($) {
            $(document).on('wooco_save_ids', function(e, ids) {
              var count = 0;
              var count_txt = '';
              if (ids.length) {
                $.each(ids, function(index, value) {
                  var value_arr = value.split('/');
                  count += parseInt(value_arr[1]);
                });
              }
              if (count == 0) {
                count_txt = 'You have selected 0 items.';
              } else if (count == 1) {
                count_txt = 'You have selected 1 item.';
              } else {
                count_txt = 'You have selected ' + count + ' items.';
              }
              if ($('.wooco_count_txt').length) {
                $('.wooco_count_txt').html(count_txt);
              } else {
                $('<div class="wooco_count_txt">' + count_txt + '</div>').insertBefore('.wooco_total');
              }
            });
          })(jQuery);
        </script>
        <?php
    }, 99 );

    Best regards,
    Dustin