Home Forums WoodMart support forum product Tabs error

product Tabs error

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #536963

    TRT
    Participant

    Hello, I have a problem with the product Tabs, for my dog ​​I had to reorder the Tabs, to do this I used the following code

    /*** reorder tabs */
    
    add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
    function woo_reorder_tabs( $tabs ) {
    
    	$tabs['description']['priority'] = 5;
    	$tabs['wd_custom_tab']['priority'] = 10; //complementos
    	$tabs['additional_information']['priority'] = 15;
    	$tabs['reviews']['priority'] = 50;
    
    	return $tabs;
    } 

    on the desktop / laptop it works fine, but on mobile devices it appears the same as the attached image whenever I don’t add the tab and this is only happening because of the change in order, if I comment/undo the code the error disappears

    • This topic was modified 10 months, 1 week ago by TRT.
    Attachments:
    You must be logged in to view attached files.
    #537384

    Hung Pham
    Keymaster

    Hi TRT,

    Thanks for reaching to us.

    Please use below code:

    add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
    function woo_reorder_tabs( $tabs ) {
    
    	$tabs['description']['priority'] = 5;
    	if ( ! empty( $tabs['wd_custom_tab'] ) ) {
    		$tabs['wd_custom_tab']['priority'] = 10; //complementos
    	}
    	$tabs['additional_information']['priority'] = 15;
    	$tabs['reviews']['priority'] = 50;
    	
    	return $tabs;
    } 

    Regards,

    #537400

    TRT
    Participant

    Thank you very much, it solved my problem, I just had to follow the logic and do the same for the description field

    add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
    function woo_reorder_tabs( $tabs ) {
    
    	if ( ! empty( $tabs['description'] ) ) {
    		 $tabs['description'] ['priority'] = 5;
    		 }
    	if ( ! empty( $tabs['wd_custom_tab'] ) ) {
    		$tabs['wd_custom_tab']['priority'] = 10; //complementos
    	}
    	$tabs['additional_information']['priority'] = 15;
    	$tabs['reviews']['priority'] = 50;
    	
    	return $tabs;
    } 
    
    #537465

    Hung Pham
    Keymaster

    Hi TRT,

    Glad to hear your issue has been resolved. Keep us in mind for future questions and concerns, we’re always here to help!

    If you have a quick minute we always appreciate a 5-star rating on our theme!

    https://themeforest.net/item/woodmart-woocommerce-wordpress-theme/reviews/20264492

    Your feedback is the motivation to improve our work and services.

    Regards,

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

The topic ‘product Tabs error’ is closed to new replies.