• Hello,

    We’re using this plugin for our Woocommerce site and it’s quite good. However, we can’t find a way for users to “Select” the product by clicking on its name, not only by checking on the box.
    Because in general, most of the users will either ticking on the box or clicking on the product name to select it. They expect both behaviors have the same results.
    Is it possible to do it with a custom insert code?
    https://prnt.sc/1uwx84w

    Thanks a lot!
    Regards,
    Mark

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WPClever

    (@wpclever)

    Hi @markd21

    Please use below snippet (How to add custom code?):

    add_action( 'wp_footer', 'woobt_js_click_on_product_name', 99 );
    function woobt_js_click_on_product_name() {
    	?>
        <script type="text/javascript">
          (function($) {
            $(function() {
              $(document).on('click touch', '.woobt-title a', function(e) {
                e.preventDefault();
    
                var $checkbox = $(this).closest('.woobt-product').find('.woobt-checkbox');
    
                $checkbox.prop('checked', !$checkbox.prop('checked')).trigger('change');
              });
            });
          })(jQuery);
        </script>
    	<?php
    }
    Thread Starter markd21

    (@markd21)

    Hi @wpclever,

    Thanks for providing the solution. However, I’ve tried to add this code into the function.php on our theme but it is not working. Nothing happens when users click on the title of products in Woo Bought Together.
    Could you please kindly recheck if there is any error?

    Regards,
    Mark

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Select Product by clicking on its name’ is closed to new replies.