WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] woocomerce 2, renaming tabs (5 posts)

  1. mariazapata
    Member
    Posted 1 year ago #

    Hi i have tried the following code to rename tabs:

    add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
    function woo_rename_tabs( $tabs ) {
    $tabs['description']['title'] = __( 'Details' );							return $tabs;
    }

    }
    and it works, but it doesnt if the tab doesn't have any content, i get the following error:
    Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in something\wp-content\plugins\woocommerce\templates\single-product\tabs\tabs.php on line 35

    I got this code from this link, I am wondering what it could be:
    http://docs.woothemes.com/document/editing-product-data-tabs/

    Thanks,

    http://wordpress.org/extend/plugins/woocommerce/

  2. mariazapata
    Member
    Posted 1 year ago #

    anyone has any idea of this?

  3. jelleheijman
    Member
    Posted 11 months ago #

    Exactly the same problem for me... Did you figured it out already?

  4. Coen Jacobs
    Member
    Plugin Author

    Posted 11 months ago #

    You didn't return the $tabs variable inside the woo_rename_tabs() function, like in the example. Do that and it will work.

  5. spaantje
    Member
    Posted 11 months ago #

    add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
    function woo_rename_tabs( $tabs ) {
    	global $product, $post;
    	if ( $product->has_attributes() ) {
    		$tabs['additional_information']['title'] = __( 'Eigenschappen' );
    	}
    	return $tabs;
    }

    Will work

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.