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

Okay
  Public Ticket #3786311
Feature Help
Open

Comments

  • Zev started the conversation

    Hello, I am trying to configure the plugin to suit my needs. I have 15 components in my composite product. Is it possible to have all of those components Hidden except for the first one (mandatory component) and use conditional logic so that once a component has been selected it will show the next component and so on and so forth.  

    Separately, Whenever I select an option for a component it throws my screen focus to the bottom of the page, making me have to scroll back up to the top, which is very annoying when having these many components.

  • Zev replied

    A screenshot of what it looks like as of now.

    Attached files:  Screenshot 2024-12-18 at 2.23.07 PM.png

  •  1,281
    Dustin replied

    Hi Zev,

    Please add the custom code below. (How to add custom code? ↗):

    add_action( 'wp_head', function () {
    	?>
        <style>
            .wooco_components .wooco_component:not(.wooco_component_required) {
                display: none;
            }
        </style>
    	<?php
    } );
    add_action( 'wp_footer', function () {
    	?>
        <script type="text/javascript">
          (function($) {
            $(document).on('wooco_init', function(e, $wrap) {
              $wrap.find('.wooco_component').each(function() {
                let $this = $(this);
    
                if (parseInt($this.find('.wooco_component_product').attr('data-id')) > 0) {
                  $this.next('.wooco_component').show();
                }
              });
            });
          })(jQuery);
        </script>
    	<?php
    }, 99 );

    If it doesn't work, please send me your website credentials (wp-admin link, username, and password) or create a dev/staging site with identical configurations so I can check for any issues.

    Best regards,
    Dustin