• Resolved Moobs

    (@nickyb713)


    I’ve add some pagination to the my account page to paginate the order history. Everything works great except when I click the “Edit Account” tab the navigation bar I created for the order table is still visible.

    I thought this would be easy enough to fix with some jQuery to match the state change of the table’s display to none when a tab is clicked.

    I added the following script to my theme’s main.js file.

    $(document).ready(function(){
    if ( $( ".shop_table" ).is( ":hidden" ) ) {
    	$('.paging-nav').css('display', 'none');
    }
    });

    I’m not very familiar with jQuery, but as far as I know this should work. I have also tried to change the display of .paging-nav with .click functions as well; to change with tab clicks.

    Does anyone have an idea of how I can change my div to display none with .shop_table? Is there something in WC that would prevent my script from running, does it need to be added to another file?

    https://www.ads-software.com/plugins/woocommerce/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    Your code only does the hidden check on page load. Sounds like you need to link it to the click event on your tabs?

    Thread Starter Moobs

    (@nickyb713)

    Thanks for taking the time to check this out. I did try creating a click event and I couldn’t get it to work either, but I’ll give that another crack today. If that doesn’t work do you know the script and its location that handles changing the table display to none for the my account page?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    No, the core my account page doesn’t have tabs.

    Thread Starter Moobs

    (@nickyb713)

    Oh thanks for letting me know it must be in Avada then. I still haven’t gotten click to work yet, but thanks for helping me narrow down the issue.

    $(document).on('click', '.account',function(){
        $('.paging-nav').css('display', 'none');
      });
    Thread Starter Moobs

    (@nickyb713)

    I was able to find the Avada script for these tabs. Thanks for letting me know this wasn’t part of the core WC.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘My Account jQuery Not Working?’ is closed to new replies.