Reordering custom tab - by javigilta - on WordPress WooCommerce support

This topic has 6 replies, 2 voices, and was last updated 5 years, 6 months ago ago by Rose Tyler

  • Avatar: javigilta
    javigilta
    Participant
    October 31, 2018 at 13:51

    Hi!

    I added a custom tab to my single product page.

    This custum tab shows after the Reviews tab (valoraciones): https://prnt.sc/lco8a2

    How can I put the Reviews tab at the end?

    I tried with this snippet, but I don’t know the name or the priority of my custom tab:

    /**
     * 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;
    }

    Thanks!

    5 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    October 31, 2018 at 14:12

    Hello,

    Please read this article https://docs.woocommerce.com/document/editing-product-data-tabs/
    Feel free to ask if you have any other questions.

    Regards

    Avatar: javigilta
    javigilta
    Participant
    October 31, 2018 at 15:22

    Hi,

    I read that article and I took the “Re-ordering Tabs” snippet:

    /**
     * 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;
    } 

    The problem is that I don’t know the name of the custom tab that I did in “Theme Options > Single Product Page > Tabs Settings”

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    October 31, 2018 at 15:39

    Hello,

    Please provide us with your site URL.

    Regards

    Avatar: javigilta
    javigilta
    Participant
    October 31, 2018 at 16:00

    Here you have

    Please, contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    October 31, 2018 at 16:12

    Please try to add this code in Theme options > Custom css:

    .tabs {
        display:  flex;
        flex-direction:  column;
    }
    .tabs .tab-reviews {
        order: 2;
    }
    .tabs .tab-description + .accordion-title {
        order: 1;
    }

    Regards

  • Viewing 6 results - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.