Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Relocate the Product tabs.
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Relocate the Product tabs.
- This topic has 19 replies, 2 voices, and was last updated 8 years by Rui Guerreiro – SUPPORT.
-
Posted in: Neighborhood
-
October 31, 2016 at 7:21 am #299526
Hi,
I want to move the product tab (product description, additional info and reviews) after Share and under product pictures. I tried the code below to relocate the product tab. But the code seems not working for me, I checked other code online, i can only remove the tab, but not relocate it to the “after_single_product_summary” area. if I increase the importance factor, there will be two product tabs at the same time.
function dante_product_tabs_override() {
add_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 10);
remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 35);
}
add_action(‘init’, ‘dante_product_tabs_override’);Thanks in advance.
October 31, 2016 at 11:03 am #299531Hi,
It doesn’t seem the correct way of doing it.
Check this documentation.
https://docs.woocommerce.com/document/editing-product-data-tabs/
Hope it helps.
-Rui
October 31, 2016 at 5:24 pm #299635Hi Rui,
I have checked the doc before and the first code inside can only remove the tabs, not relocate (the add_action is not working).
I got the code above from the previous post in this forum, please see the attached pic.
Hope there is a solution for that.
Thank you.Attachments:
You must be logged in to view attached files.October 31, 2016 at 5:57 pm #299655did you tried this one that is in the page I sent you?
https://www.dropbox.com/s/o29zy1tqphzheh4/Screenshot%202016-10-31%2016.58.23.png?dl=0-Rui
October 31, 2016 at 6:59 pm #299677Hi Rui,
I tried this one (reorder tabs), it seems nothing got changed, the tabs order is still the same.
All i am looking for is to move the product tab under the picture and share row, so it can have the width of 8 column (4|4 4)
Please see the attached pic.Looking forward to your feedback.
Attachments:
You must be logged in to view attached files.November 1, 2016 at 12:33 pm #299776Do you have a child theme? are you placing this code inside the functions.php of the child theme?
If so, provide me admin credentials to have a quick look.
-Rui
November 1, 2016 at 5:45 pm #299872This reply has been marked as private.November 1, 2016 at 5:57 pm #299876Hi,
Check again, the problem was your child theme that wasn’t activated.
You need to do it or else you aren’t using a child theme.-Rui
November 1, 2016 at 10:35 pm #299911Hi,
I have tried on Child theme, the re_ordering tabs function (the previous link you sent me) is working, and for the
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10);
after I change the importance factor from “10” to “5”, it is working too, please see the attached picture 1.
But the following code is not workingfunction dante_product_tabs_override() { add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10); remove_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 35); } add_action('init', 'dante_product_tabs_override', 5);
I can not move the product tabs below the picture and share row, please see the attached picture 2.
Best,
Baron
Attachments:
You must be logged in to view attached files.November 2, 2016 at 10:02 pm #300116I changed the order since that wasn’t making sense to me, because first you have to remove it and add it later with a different priority.
function dante_product_tabs_override() { remove_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 35); add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10); } add_action('init', 'dante_product_tabs_override', 5);
Give it a try.
-Rui
November 3, 2016 at 6:15 am #300141Hi Rui,
Thank you for your feedback, I tried the code above and it is not working.
If I change
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10);
to
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 5);
then it will duplicate another tab in the target area, but the remove action seems not working. (please see the attached pic)Attachments:
You must be logged in to view attached files.November 3, 2016 at 11:21 am #300177Try to change the remove line priority, replace it by this one.
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
p.s- Since you have 2 tabs section there is also the change of hiding the 1s one with css, but try the code above first.
-Rui
November 3, 2016 at 5:01 pm #300343Hi Rui,
I changed the remove line priority from 35 to 10 and to 1, it was not working.
I have tried the code below from Woocommerce Docs, which is the only one that can actually remove the tabs, but it will remove the duplicate one at the same time.add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); function woo_remove_product_tabs( $tabs ) { unset( $tabs['description'] ); // Remove the description tab unset( $tabs['reviews'] ); // Remove the reviews tab unset( $tabs['additional_information'] ); // Remove the additional information tab return $tabs; }
November 3, 2016 at 5:12 pm #300347In that case. Add the code below to your custom css option.
.summary .woocommerce-tabs.wc-tabs-wrapper { display: none; }
-Rui
November 3, 2016 at 5:16 pm #300349Hi Rui,
Thank you so much, the css works!
Best,
Baron
-
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.