Extra tabblad met code toevoegen in WooCommerce
Zonder plugin een extra tabblad bij je producten in WooCommerce? Voeg deze code toe en pas aan waar nodig in je functions.php of via de plugin Code Snippets.
/* Add a custom product data tab
*/
add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ );
function woo_new_product_tab( $tabs ) {
// Adds the new tab
$tabs[‘vraag_tab’] = array(
‘title’ => __( ‘Stel een vraag’, ‘woocommerce‘ ),
‘priority’ => 50,
‘callback’ => ‘woo_new_product_tab_content’
);
return $tabs;
}
function woo_new_product_tab_content() {
// The new tab content
gravity_form(1, false, false, false, ”, true, 12);
}
/* Rename product data tabs
*/
add_filter( ‘woocommerce_product_tabs’, ‘woo_rename_tabs’, 98 );
function woo_rename_tabs( $tabs ) {
$tabs[‘additional_information’][‘title’] = __( ‘Specificaties’ ); // Rename the additional information tab
return $tabs;
}