WooCommerce function to move similar Products into data tabs

<?php

// Move similar Products in new Tab
 
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
 
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
 
function woo_new_product_tab( $tabs ) {
     
$tabs['related_products'] = array(
    'title'     => __( 'Dein neuer Tab', 'woocommerce' ),
    'priority'  => 50,
    'callback'  => 'woo_new_product_tab_content'
);
    return $tabs;
}
 
function woo_new_product_tab_content() {
woocommerce_related_products();
}

?>

Leave a Reply