- This topic has 7 replies, 3 voices, and was last updated 3 years, 11 months ago by David.
-
AuthorPosts
-
March 31, 2020 at 5:05 am #1220609johnaps
Hello GP Team! I hope you and your fams are all well and about!!
I have searched the forum and the web for doing this but i have only found how to hide/rearrange etc the tabs…
I would really want to do the following:
1. To “eliminate” tabs completely BUT make their panels to be shown always
2. additional information tab and panel to be removed completely
3. comments panel which would be always visible to now be positioned after product description panel
4. (additional) move the related products after woocommerce shortdescription and before product description panel.Is this possible?
March 31, 2020 at 4:01 pm #1221473TomLead DeveloperLead DeveloperHi there,
You can remove the tabs and just show the sections like this:
.woocommerce div.product .woocommerce-tabs ul.tabs { display: none; } .woocommerce div.product .woocommerce-tabs .panel { display: block !important; }
As for re-ordering things, I’m not sure what the best way to do that would be. It may be worth checking with WooCommerce support to see if there’s an easy solution.
April 4, 2020 at 7:50 am #1226356johnapsHello Tom!! Thank you for the css it did the trick!!
I have found the following code for future referance if anyone needs it to reorder the elements¨
//reorder single product page elements add_filter( 'woocommerce_product_tabs', 'reordered_tabs', 98 ); function reordered_tabs( $tabs ) { $tabs['description']['priority'] = 15; $tabs['reviews']['priority'] = 25; return $tabs; } add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 20); add_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 35 ); do_action( 'woocommerce_product_after_tabs' ); add_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 5 ); add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 10 ); do_action( 'woocommerce_after_main_content' );
Ι had added it in functions.php in child theme and i got the wanted result… problem is the whole layout i wanted was “AddeD” after all the existing layout of the single product page, thus duplicating the same elements…
I tried copying single-product.php to my child theme but i cant figure out no matter how much i try where the above code should go…
https://gofile.io/?c=31GU8x
here is my single-product.php file!Can you help me out place the above actions where they should go 🙂 ?
April 4, 2020 at 4:27 pm #1226813TomLead DeveloperLead DeveloperI think you only need this part:
add_filter( 'woocommerce_product_tabs', 'reordered_tabs', 98 ); function reordered_tabs( $tabs ) { $tabs['description']['priority'] = 15; $tabs['reviews']['priority'] = 25; return $tabs; }
April 4, 2020 at 5:04 pm #1226820johnapsI would like to move related products above description!! So i need more than that, but problem is where to put this code, in functions .php ?
Problem is my code adds the related product again and every element is added again in the order i want, but how do i remove the already existing elements;; or instead of removing them i should add the code somewhere else than functions.php maybe??April 5, 2020 at 7:13 am #1227256DavidStaffCustomer SupportAll of these codes should go in your child theme functions.php
Simply remove the function before adding it where you want it ie.
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
The article will help when it comes to removing existing functions:
https://businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/
April 5, 2020 at 7:45 am #1227290johnapsPerfect support 🙂
April 5, 2020 at 4:28 pm #1227877DavidStaffCustomer SupportGlad we could be of help
-
AuthorPosts
- You must be logged in to reply to this topic.