Home Forums WoodMart support forum Changing Tab Order on Product Pages

Changing Tab Order on Product Pages

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #540243

    saskia
    Participant

    Hello,

    I kindly request information on whether it is possible to change the order of tabs.

    The “Payment & Shipping” tab appears as a standard feature for each individual product and should therefore be positioned last.

    The other tabs need to be entered separately for each individual product and should therefore be positioned at the beginning.

    Attachments:
    You must be logged in to view attached files.
    #540286

    Hung Pham
    Keymaster

    Hi saskia,

    Thanks for reaching to us.

    Use the below code for reordering the tabs, just set priority values per your needs. Paste the code into the functions.php file in your Child theme.

    /**
     * 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
    
    	// Custom Tabs are from Product Settings
    	// $tabs['wd_custom_tab']['priority'] = 2; 
    	// $tabs['wd_custom_tab_2']['priority'] = 3;
    
    	// Additional Tabs are from Theme Settings
    	// $tabs['wd_additional_tab']['priority'] = 4;
    	// $tabs['wd_additional_tab_2']['priority'] = 5;
    
    	return $tabs;
    }

    Regards,

Viewing 2 posts - 1 through 2 (of 2 total)