Home › Forums › WoodMart support forum › product page custom tab orders
product page custom tab orders
- This topic has 6 replies, 2 voices, and was last updated 2 years, 11 months ago by Elise Noromit.
-
AuthorPosts
-
February 1, 2022 at 9:02 pm #349532
auroramarinecodeParticipantI am creating a custom tab from your theme and using html block in it. on the product it shows at last i want that in second number. Can you guide me how can i do it? Please see the image for better understanding.
capture.jpg = I am creating tab from here
capture1.jpg = on the page it is showing in the last. I want to it number 2.If this is woocommerce tab then please still help me send me some tutorial or links. thanks
Attachments:
You must be logged in to view attached files.February 2, 2022 at 12:50 am #349577
Elise NoromitMemberHello,
WoodMart does not have the option to change the order of the tabs. Please check this Woocommerce manual: https://woocommerce.com/document/editing-product-data-tabs/
Best Regards
February 2, 2022 at 1:01 am #349582
auroramarinecodeParticipantI have already read about that and woocommerce has only 3 tabs. Description and reviews i am using in your theme and additional information i hid it. The tab i am talking about it is in your theme. You can see on single product page it has name custom tab, custom title name etc. Can you tell me how can i set it in second place? If you cant solve this problem then at least tell me what is method name so i can put some coding in function.php
February 2, 2022 at 11:19 am #349668
Elise NoromitMemberHello,
The Woocommerce gives this code:
/** * Reorder product data tabs */ add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 ); function woo_reorder_tabs( $tabs ) { $tabs['reviews']['priority'] = 5; // Reviews first $tabs['description']['priority'] = 10; // Description second $tabs['additional_information']['priority'] = 15; // Additional information third return $tabs; }
You need to take the tab class and set the order: https://gyazo.com/d9e2224a5947d1baa627a2cb79dc4edb
/** * Reorder product data tabs */ add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 ); function woo_reorder_tabs( $tabs ) { $tabs['description_tab']['priority'] = 5; // Description first $tabs['wd_additional_tab_tab']['priority'] = 10; //Additional information custom tab second $tabs['INSERT THE TAB CLASS HERE']['priority'] = 15; // DESCRIBE THE TAB HERE return $tabs; }
Please find this line:
$tabs['INSERT THE TAB CLASS HERE']['priority'] = 15; // DESCRIBE THE TAB HERE
insert the tab class, change 15 to 20, then 25, then 30 for each tab and set the order for each tab from your product page.
Best Regards
February 3, 2022 at 6:40 am #349805
auroramarinecodeParticipantno it did not work kindly please try to understand the question first. Last tab “people also ask” is coming from your theme (see image capture3.jpg) i want this tab on number 2. I tried taking classes exactly same as yours (see image capture.jpg) then i placed the coding in function.php (see image capture1.jpg) then i saw the page all tabs was empty (see image capture2.jpg). it looks like this was empty query and nothing is coming then i changed this “$tabs[‘description_tab’][‘priority’] = 5;” to “$tabs[‘description’][‘priority’] = 5;” then description came up. which means taking css classes does not work at all and you were taking css classes. Again i am using only description tab form woocommerce and “people also ask” tab is coming from product page custom tab.
Attachments:
You must be logged in to view attached files.February 3, 2022 at 7:11 am #349813
auroramarinecodeParticipanti found another way and i did it. Thanks
February 3, 2022 at 10:38 am #349861
Elise NoromitMemberHello,
We are glad you have solved the issue.
If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
Tagged: product page custom tab orders
The topic ‘product page custom tab orders’ is closed to new replies.
- You must be logged in to create new topics. Login / Register