• Resolved dlsorex

    (@dlsorex)


    Hello,

    as far as I understood the tabs are placed after the description tab.

    Is it possible to show the custom tabs before the description tab?
    If yes, only in the paid version or in the free version as well?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @dlsorex,

    The paid version has some built-in features for this but you can do this in the free version with a pretty simple function. A lot of our users have this function added.

    In this example, we’re setting the order of the tabs Description, Product Specs, Care Cleaning, Payment Options, and Delivery respectively.

    add_filter( 'woocommerce_product_tabs', 'yikes_woo_reorder_tabs', 98, 1 );
    
    function yikes_woo_reorder_tabs( $tabs ) {
    
    	if ( isset( $tabs['description'] ) ) {
    		$tabs['description']['priority'] = 1;
    	}
    
    	if ( isset( $tabs['product-specs'] ) ) {
    		$tabs['product-specs']['priority'] = 2;
    	}
    
    	if ( isset( $tabs['care-cleaning'] ) ) {
    		$tabs['care-cleaning']['priority'] = 3;
    	}
    
    	if ( isset( $tabs['payment-options'] ) ) {
    		$tabs['payment-options']['priority'] = 4;
    	}
    
    	if ( isset( $tabs['delivery'] ) ) {
    		$tabs['delivery']['priority'] = 5;
    	}
    
    	return $tabs;
    }

    For your tabs, just change the 'priority' and tab slug (e.g. delivery) to whatever you want.

    Does that make sense? Are you familiar with adding custom PHP functions to your site?

    Cheers,
    Kevin.

    Thread Starter dlsorex

    (@dlsorex)

    Thank you very much, works like a charm!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Order of tabs’ is closed to new replies.