Assistance Needed for Mobile Menu Widget with Category Functionality link clickable

This topic has 12 replies, 3 voices, and was last updated 1 months ago ago by Luca Rossi

  • Avatar: donaceli
    donaceli
    Participant
    January 30, 2025 at 19:36

    Hello,

    I am working on fixing the mobile version of the website and need help making the parent category clickable. Currently, when a user clicks on the category text, it expands to show the subcategories. I would like to change this behaviour so that clicking on the parent category the product page get opened, while the subcategory dropdown should only open when the user clicks on the corresponding icon.

    I have tried various widgets, but none seem to have the option I’m looking for, which is quite frustrating. I’ve attached a screenshot for reference.

    Thank you for your help!

    Files is visible for topic creator and
    support staff only.
    11 Answers
    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff
    January 31, 2025 at 09:06

    Hello, @donaceli,

    Thank you for contacting us and for using XStore.

    Please, check our answer for the same request you have -> https://www.8theme.com/topic/shop-page-is-not-clickable-from-mobile-menu/#post-396536

    We hope this helps. Should you require any further assistance, please do not hesitate to reach out. We are here to help you.

    Best Regards,
    The 8Theme Team

    Avatar: donaceli
    donaceli
    Participant
    January 31, 2025 at 17:15

    Thank you so much for your help. However, the information in the post that you have shared isn’t helpful because our situation is different. We have Category > Subcategory > Sub Subcategory situation and multiple Parent categories so it would make the menu list very long if we tried to implement a similar approach. Also, we don’t use the Header Builder for this, we use Elementor Pro widgets and this particular widget for elementor is by Xstore. Please review the mobile version of our website at https://fixassist.ie to see the issue in question.

    Kind regards,
    Don

    Avatar: Justin
    Luca Rossi
    Support staff
    February 2, 2025 at 14:50

    Hi @donaceli,

    Please try adding this custom code under functions.php file locates in your child theme:

    
    add_action('wp_footer', 'n2t_wp_footer');
    function n2t_wp_footer() {
        ?>
        <script>
            jQuery(document).on('click touchend', '.etheme-elementor-nav-menu.vertical li a.item-link.etheme-elementor-nav-menu-item.etheme-elementor-nav-menu-item-parent', function (e){
                window.location.href = jQuery(this).attr('href');
            });
    
            jQuery(document).on('click touchend', '.etheme-elementor-nav-menu.vertical li a.item-link.etheme-elementor-nav-menu-item.etheme-elementor-nav-menu-item-parent span.etheme-elementor-nav-menu-item-arrow', function (e){
                var parent = jQuery(this).parent().parent();
                jQuery(parent).next('.nav-sublist-dropdown').slideToggle();
                return false;
            });
        </script>
        <?php
    }
    

    Hope it helps!

    Avatar: donaceli
    donaceli
    Participant
    February 3, 2025 at 10:30

    Hello,

    Thanks for the code. It works on the Parent Category now, but the issue is with subcategories that have a child. When I click on the icon beside the subcategory, no items are displayed.

    Avatar: Justin
    Luca Rossi
    Support staff
    February 4, 2025 at 11:52

    Dear @donaceli,

    Can you please update the custom code to this?

    
    add_action('wp_footer', 'n2t_wp_footer');
    function n2t_wp_footer() {
        ?>
        <script>
            jQuery(document).on('click touchend', '.etheme-elementor-nav-menu.vertical li a.item-link.etheme-elementor-nav-menu-item.etheme-elementor-nav-menu-item-parent', function (e){
                window.location.href = jQuery(this).attr('href');
            });
            
            jQuery(document).on('click touchend', '.etheme-elementor-nav-menu.vertical li a span.etheme-elementor-nav-menu-item-arrow', function (e){
                var parent = jQuery(this).parent().parent();
            
                if(jQuery(parent).next('.nav-sublist-dropdown').length > 0)
                    jQuery(parent).next('.nav-sublist-dropdown').slideToggle();
            
                if(jQuery(parent).next('.nav-sublist').length > 0)
                    jQuery(parent).next('.nav-sublist').slideToggle();
            
                return false;
            });
        </script>
        <?php
    }
    

    Let us know how it goes!

    Avatar: donaceli
    donaceli
    Participant
    February 4, 2025 at 18:58

    Hi, thank you for the code. Could you please see the mobile version of the website? I will leave the code in the functions file for you for now but the required result is still not achieved. It does open subcategories when the arrow icon is clicked on but clicking on the second child item doesn’t lead to opening a page. Also, the arrows changes to show that the subcategory is open but it doesn’t open. This will confuse the user.

    Avatar: Justin
    Luca Rossi
    Support staff
    February 5, 2025 at 05:51

    Hi @donaceli,

    Can you please share us with your WP Admin account again?

    Thank you!

    Avatar: donaceli
    donaceli
    Participant
    February 5, 2025 at 19:08

    Private details in private content area.

    Please contact administrator
    for this information.
    Avatar: Justin
    Luca Rossi
    Support staff
    February 6, 2025 at 05:32

    Hi Don,

    The password seems incorrect: https://prnt.sc/HykUUZi5UDTh.

    Could you please double check?

    Thank you!

    Avatar: donaceli
    donaceli
    Participant
    February 6, 2025 at 20:32

    My apologies, someone from the team changed it. Here are updated details:

    Please contact administrator
    for this information.
    Avatar: Justin
    Luca Rossi
    Support staff
    February 7, 2025 at 05:25

    Dear Don,

    We’ve updated the custom codes a little bit.

    Everything should be working fine now.

    Could you please check again?

    Thank you!

  • Viewing 12 results - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.