• Resolved nineplanetsllc

    (@nineplanetsllc)


    We’ve got a Product Categories List block used as a widget and set as a dropdown, and when we select a category from the menu and hit the button to go to it, nothing happens. It was working fine up until a couple days ago, and it looks like there was a recent update to the plugin, so I’m guessing that was when it started.

    I played around with the JavaScript in the onclick handling the redirect:

    const url = document.getElementById( 'product-categories-62f2a59253c7f-select' ).value; if ( 'false' !== url ) document.location.href = url;

    If I remove the “const” from the beginning in the Chrome Inspector, it starts working fine, so it seems related to that.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @nineplanetsllc

    I understand that upon selecting a category in the Product Categories List block, nothing is happening.

    If I remove the “const” from the beginning in the Chrome Inspector, it starts working fine, so it seems related to that.

    That’s a good finding but can you please share a link to your site so we can take a look? I wasn’t able to replicate the same behavior on my test site.

    * If you need to share screenshots, we recommend https://snipboard.io for easily sharing screenshots – please follow the instructions on that page, then paste the URL in this thread.

    Thread Starter nineplanetsllc

    (@nineplanetsllc)

    You can check it out here:

    https://dev.nwrvsupply.com/

    The menu in question is on the left side of the header, just below the logo.

    Hi @nineplanetsllc

    Thank you for sharing the link. I can see that the category list dropdown is not responsive on your site. However, I can’t replicate the same issue on my test site which only has the latest versions of the WooCommerce plugin and Storefront theme activated.

    To get a better understanding of your site setup, can you please share a copy of your site’s System Status? You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”.  Once you’ve done that, paste it here in your response.

    Thread Starter nineplanetsllc

    (@nineplanetsllc)

    I’ve got the status info copied to pastebin here:

    https://pastebin.com/wKNFCc1q

    Hi there @nineplanetsllc – I did some troubleshooting of this and it looks like the Astra theme is capturing the onClick handler for the button. The relevant code is in their frontend.js theme:

    
    
    button.onclick = function() {
    			if ( -1 !== containerMenu.className.indexOf( 'toggled' ) ) {
    				containerMenu.className = containerMenu.className.replace( ' toggled', '' );
    				button.setAttribute( 'aria-expanded', 'false' );
    				menu.setAttribute( 'aria-expanded', 'false' );
    			} else {
    				containerMenu.className += ' toggled';
    				button.setAttribute( 'aria-expanded', 'true' );
    				menu.setAttribute( 'aria-expanded', 'true' );
    			}
    		};

    You could reach out to their support team and see if that’s something they could address.

    The specific relevant code in WooCommerce Blocks has been the same for 3 years.

    I hope that helps. Let us know how that goes!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Product Categories List menu not working’ is closed to new replies.