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

Okay
  Public Ticket #3545635
Display total number of items
Closed

Comments

  •  6
    Samuel started the conversation

    Hi!

    Is there a way to display the total number of items selected right next/before the bundle price in the single product page?

    Thx!

  •  767
    Janilyn replied

    Hi Samuel,

    Thank you for contacting WPClever Support Forum. 

    We’ve received your ticket and assigned one of our developers to help you with that. 

    He’ll be looking into your question and responding with specific instructions as soon as possible. 

    Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  1,225
    Dustin replied

    Hi Samuel,

    Please add the below custom code (How to add custom code?)

    add_action( 'wp_footer', function () {
        ?>
        <script type="text/javascript">
          (function($) {
            $(document).on('woosb_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 = '<div class="woosb_count_txt">You have selected 0 items</div>';
              } else if (count == 1) {
                count_txt = '<div class="woosb_count_txt">You have selected 1 item</div>';
              } else {
                count_txt = '<div class="woosb_count_txt">You have selected ' + count + ' items</div>';
              }
              if ($('.woosb_count_txt').length) {
                $('.woosb_count_txt').html(count_txt);
              } else {
                $(count_txt).insertAfter('.woosb-products');
              }
            });
          })(jQuery);
        </script>
        <?php
    }, 99 );

    And the result https://app.screencast.com/rsB16jUOAoKE0

    Best regards,
    Dustin

  •  6
    Samuel replied

    Great! Thx! Worked like a charm :)

  •  1,225
    Dustin replied

    You're welcome!smile.png

    If you are satisfied with our plugin and support, please reward it with a full five-star ★★★★★ rating. https://wordpress.org/support/plugin/woo-product-bundle/reviews?rate=5#new-post Thank you in advance! ♥

    Best regards,
    Dustin