Reorder tabs in WooCommerce

By | May 2, 2020

woocommerce product detail page contains tabs with the product attributes and if we add the additional tab with more information for the product the tab listed in the last, but we want to show the tab in the second or third in the order.so for these types of issues some snippets of the code are used in WordPress.

Here is a piece of code through which you can easily rearrange or manage tabs of the product page in your required order.

function qreuz_reorder_tabs_product_page( $tabs )

{

$tabs[‘description’][‘priority’] = 5;

$tabs[‘additional_information’][‘priority’] = 10;

$tabs[‘reviews’][‘priority’] = 15;

return $tabs;

}

add_filter( ‘woocommerce_product_tabs’, ‘qreuz_reorder_tabs_product_page’, 98 );

How to upload the code as it works properly?

  • upload the code snippet to the functions.php of your child theme
  • modify the values for the priority for each tab to change the order of the tabs as per requirements

Leave a Reply

Your email address will not be published. Required fields are marked *