How to change the size chart tab position in WooCommerce

The Dotstore Product Size Charts for WooCommerce plugin displays the size chart as a tab on the single product page.

You can change the position of the Size Chart tab by adding a simple PHP filter to your website.

If you are using the size chart position as an " Additional Tab", it will display a size chart tab. But by default, this tab will appear at the end (after all the default tabs).

Screenshot 1: (Front: Size chart tab default position )

If you would like to change this tab position, then we have a filter code that you may use to modify the position of this tab.

Filter code:
function scfw_size_chart_tab_priority_setting() {
    return 1;
}
add_filter( 'scfw_tab_priority_setting', 'scfw_size_chart_tab_priority_setting' );
Add the mentioned filter code to your theme > function.php file and change the priority number based on your requirements. For Example, change the priority number to 10 if you want to display the tab in the second position.

How the tab priority works

The returned number controls the position of the Size Chart tab.

  • A lower number moves the tab toward the beginning.
  • A higher number moves the tab toward the end.
  • In the example above, return 1;  places the Size Chart tab before most other product tabs.

You can change the priority number based on where you want the tab to appear.

For example:

return 50;

This will move the Size Chart tab after tabs that have a priority lower than 50.

Screenshot 2: (Front: Size chart tab with the first position )

Screenshot 3: (Front: Size chart tab with the second position )

Important note

Always add custom PHP code to a child theme or use a code snippets plugin. Avoid editing the main theme files because your changes may be removed when the theme is updated.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.