Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1058614
    steve h
    Participant

    Hi, the tabs have stopped working recently, & i have just updated woocommerce to version 2.6.1. I’m not 100% sure if this update caused the problem. I’ve turned off all other plugins but this did not solve the problem. Any sugestions would be much appreciated cheers!

    #1058895
    Friech
    Moderator

    Hi There,

    Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    Cheers!

    #1060435
    steve h
    Participant
    This reply has been marked as private.
    #1060724
    Rue Nel
    Moderator

    Hello There,

    Thanks for providing the very detailed information! Regretfully we cannot login to your account because it needs authentication (http://prntscr.com/blhmaq). Could you please give us access or temporarily disable it? For the meantime, this issue could just be a caching issue. Are you using CloudFlare or may have installed a caching plugin like WordFence, W3 Total Cache or WP Super Cache? Please keep in mind that after doing every updates, always remember to clear all caches when updating so that the code from the latest release is always in use. This will help you to avoid any potential errors.

    Please let us know how it goes.

    #1060828
    steve h
    Participant
    This reply has been marked as private.
    #1060851
    Lely
    Moderator

    Hi There,

    Please try to update the code on your customizer, from this:

     // Conditions
    // 1. Menu should be using full url, eg. http://site.com/#x-content-band-1 and not just #x-content-band-1
    // 2. Use just one menu for both Primary and One Page.
    
    jQuery(function($){
    	
    	var window_base = window.location.href.split("#").slice(0)[0];
    	var window_hash = window.location.hash == '' ? 'body' : '#'+window.location.href.split("#").slice(-1)[0];
    	var outbound = /^https?:///i;
    
    	$('.x-nav a').each(function(){ //Scan links and convert them to relative hash for one page navigation's Active statuses to work properly when manually scrolling
    
    		var hash = /#/.test( $(this).attr('href') )  ? '#' + $(this).attr('href').split("#").slice(-1)[0] : '';
    		var anchor_base = /#/.test( $(this).attr('href') ) ? $(this).attr('href').split("#").slice(0)[0] : $(this).attr('href');
    
    	    if(hash) { //Does it have hash? then perform check
    		    if(anchor_base == window_base) { //If same page, then no need to reload, just make it relative
    		    	$(this).attr('href', hash);
    		    } // Else, leave it that way. So when user clicked, it will just link them to outbound page
    		}
    
    	}).click(function(e){ //Enable Parent and Submenu scrolling
    		
    		var hash = /#/.test( $(this).attr('href') ) ? '#' + $(this).attr('href').split("#").slice(-1)[0] : 'body';
            
    	    if(hash && !outbound.test( $(this).attr('href') ) ) { //Does it have relative hash?
    
    		    	e.preventDefault(); //Disable jumping
    		    	e.stopPropagation();
    
    		    	$('html,body').stop().animate({ scrollTop: $( hash ).offset().top - $('.x-navbar').height()},700 ,'swing');
    
    		    	//Now add active status for automatic scrolling
    		    	$('.x-nav li').removeClass('current-menu-item');
    		    	$(this).parent().addClass('current-menu-item');
    
    		}
    
    	});
    
    	//$('html,body').css({ scrollTop : 0});
    	setTimeout( function(){
    	$(document).ready(function(){ // Enable auto scroll when loaded.
    		$('.x-nav li').removeClass('current-menu-item');
    		//$('a:not([href*="#"])').parent().addClass('current-menu-item'); For experiment only
    
    		if(window_hash) {
    			$('a[href$="'+window_hash+'"]').click(); //Click it, so it will use default click from one page navigation event and submenu event
    		}
    	}); }, 300);
    
    });

    To this:

    
     // Conditions
    // 1. Menu should be using full url, eg. http://site.com/#x-content-band-1 and not just #x-content-band-1
    // 2. Use just one menu for both Primary and One Page.
    
    jQuery(function($){
    	
    	var window_base = window.location.href.split("#").slice(0)[0];
    	var window_hash = window.location.hash == '' ? 'body' : '#'+window.location.href.split("#").slice(-1)[0];
    	var outbound = /^https?:///i;
    
    	$('.x-nav-wrap > .x-nav a').each(function(){ //Scan links and convert them to relative hash for one page navigation's Active statuses to work properly when manually scrolling
    
    		var hash = /#/.test( $(this).attr('href') )  ? '#' + $(this).attr('href').split("#").slice(-1)[0] : '';
    		var anchor_base = /#/.test( $(this).attr('href') ) ? $(this).attr('href').split("#").slice(0)[0] : $(this).attr('href');
    
    	    if(hash) { //Does it have hash? then perform check
    		    if(anchor_base == window_base) { //If same page, then no need to reload, just make it relative
    		    	$(this).attr('href', hash);
    		    } // Else, leave it that way. So when user clicked, it will just link them to outbound page
    		}
    
    	}).click(function(e){ //Enable Parent and Submenu scrolling
    		
    		var hash = /#/.test( $(this).attr('href') ) ? '#' + $(this).attr('href').split("#").slice(-1)[0] : 'body';
            
    	    if(hash && !outbound.test( $(this).attr('href') ) ) { //Does it have relative hash?
    
    		    	e.preventDefault(); //Disable jumping
    		    	e.stopPropagation();
    
    		    	$('html,body').stop().animate({ scrollTop: $( hash ).offset().top - $('.x-navbar').height()},700 ,'swing');
    
    		    	//Now add active status for automatic scrolling
    		    	$('.x-nav-wrap > .x-nav li').removeClass('current-menu-item');
    		    	$(this).parent().addClass('current-menu-item');
    
    		}
    
    	});
    
    	//$('html,body').css({ scrollTop : 0});
    	setTimeout( function(){
    	$(document).ready(function(){ // Enable auto scroll when loaded.
    		$('.x-nav-wrap > .x-nav li').removeClass('current-menu-item');
    		//$('a:not([href*="#"])').parent().addClass('current-menu-item'); For experiment only
    
    		if(window_hash) {
    			$('a[href$="'+window_hash+'"]').click(); //Click it, so it will use default click from one page navigation event and submenu event
    		}
    	}); }, 300);
    
    });

    Then clear cache and check the Woocommerce tabs again. The custom codes affect the tabs.

    Hope this helps.

    #1062513
    steve h
    Participant

    Awesome that solved the problem thanks a lot! you guys rule!!

    #1062641
    Nico
    Moderator

    Happy to hear that.

    Feel free to ask us again.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1058614 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>