I'm having a strange problem with custom tabs on the product page. When you visit the page as a visitor, the tabs are clickable but show no content (looks like js is disabled or something?)
Once registered or logged in, everything is working properly.. I've search a lot about common issues but couldn't find any, I would be more than thankful if you guys could take a look.
Apparently, when you visit the site as a guest, it places the custom made tab outside the <div class="woocommerce-tabs wc-tabs-wrapper"> and therefore it won't open the tab content.
I found a (temporary?) solution to this, you have to give the tabs a fixed priority and put one of the main tabs (reviews, description or additional information) as the last one.
I'm not sure if this is a Theme or a Woocommerce error? I've tried several plugins and also added the tabs myself but they all resulted with the same problem (not showing tab content as guest visitor).
add_filter( 'woocommerce_product_tabs', 'wpb_reorder_tabs', 98 );
function wpb_reorder_tabs( $tabs ) {
$tabs['reviews']['priority'] = 5; // Reviews first
$tabs[test_tab]['priority'] = 10; // Test tab second
$tabs['description']['priority'] = 15; // Description third
$tabs['additional_information']['priority'] = 20; // Additional information fourth
return $tabs;
}
Dear
I'm having a strange problem with custom tabs on the product page. When you visit the page as a visitor, the tabs are clickable but show no content (looks like js is disabled or something?)
Once registered or logged in, everything is working properly.. I've search a lot about common issues but couldn't find any, I would be more than thankful if you guys could take a look.
Kind regards
{"wp":{"use":false,"adminUrl":"http://www.kollekt.be/wp-admin","username":"Vircom","password":"Zonhoven002!"},"ftp":{"use":false,"url":"","port":"","user":"","password":"","path":""}}
Apparently, when you visit the site as a guest, it places the custom made tab outside the
<div class="woocommerce-tabs wc-tabs-wrapper"> and therefore it won't open the tab content.
I found a (temporary?) solution to this, you have to give the tabs a fixed priority and put one of the main tabs (reviews, description or additional information) as the last one.
I'm not sure if this is a Theme or a Woocommerce error? I've tried several plugins and also added the tabs myself but they all resulted with the same problem (not showing tab content as guest visitor).
Hi Daan,
It is weird how that happens, because in our demo site it didn't happened as a guest user:
http://demo.kaliumtheme.com/shop/product/boskke-cube/
So I can take a look if you remove that temporary fix just to see where is the issue.
To make it easer, just send me your WP credentials tell me where is that code added, so I will temporarily remove it to see where is the issue.
To include your credentials click Insert Credentials button in editor toolbar. (See how)
Hi Daan,
I've assigned the same priorities in Tab Manager:
(view large version)
And it fixed the issue, so tabs are accessible even when user is not logged in.
The fix you have added in functions.php is still there, but I've commented it, so it is not being executed, so it solved the issue.
Hey Arlind!
Thank you for taking the time to give me the proper solution of the problem, I didn't thought about using he same priorities.
Great support!
Hi Daan,
Glad to hear that
Will set this ticket as solved from here.