The link to the WooCommerce doc is the authoritative guidance on reordering tabs so its worth persevering.
– in what way didn’t it work? ie had no affect, gave you a white out or an error message?
– try increasing the priority parameter from 98 to PHP_INT_MAX
– ensure you are using straight quotes ' " and not smart quotes ‘ ”
– ensure the first line of functions.php contains: <?php
– in wp-config.php, set define('WP_DEBUG', true); and see if any errors or warnings show up
– validate the whole contents of functions.php using this service:
http://phpcodechecker.com/
– your code should go in functions.php for a child theme to make it update-safe
– paste your functions.php at pastebin.com (free service) and post the link here so others can take a look
thanks for the quick reply. I used the validator for the following php codes, and yes I am adding to child theme.
I have to mention that the them allows you to add an extra tab that you can rename.
when I add http://pastebin.com/7Xr17ZZ5 or http://pastebin.com/pRihBebai get the following error, even though validator tool finds no issue.
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /home3/lnfmia/public_html/diabeticplaza.com/wp-content/themes/flatsome/woocommerce/single-product/tabs/tabs.php on line 61
-
This reply was modified 9 years, 1 month ago by
Laurendo.
Flatsome might be doing some funky stuff with their template overrides; You getting the same thing when switching to the default Twenty Sixteen / Storefront theme?
Also just pointing this extension out for further reference: https://www.woocommerce.com/products/woocommerce-tab-manager/
They sure are doing something funky, but they don’t want to take responsibility for it.
Could you by any change be more specific on the “funky stuff”, so I can let them know – maybe if you can see something in Developer console? I am not knowledgable enough to detect any errors by looking at the source code…
I switched to Twenty Sixteen and storefront and it works fine on both of them.
The error that you give is what you get if you set a tab property for a tab that does not exist for the particular product. To avoid this, enclose every tab= line with an isset() check, so:
if( isset($tabs['more_offers']) ) {
$tabs['more_offers']['priority'] = 5;
}