Soheil
Soheil

Reputation: 113

Add secondary attributes tab to woocommerce

I need to add another tab to product tabs section of woocommerce with the name of features and it's content fills just like attributes section. the source be same but data store in separate meta data and show it in another tab in product page view section. any Idea how should to do this? thank you in advance

Upvotes: 0

Views: 656

Answers (1)

Beneris
Beneris

Reputation: 637

Here is my code

add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );

function woo_new_product_tab( $tabs ) {
$tabs['featurestab'] = array(
    'title'     => __( 'Features', 'woocommerce' ),
    'priority'  => 15,
    'callback'  => 'features_tab_content');
  return $tabs;
}

function features_tab_content() {
  echo 'Your product ('.get_the_ID().') features.';
}

Upvotes: 1

Related Questions