New added product tabs not visible on products page
-
Wordpress: 5.2.4
Theme: Divi v4.0.4
Plugin: WooCommerce 3.7.1I am trying to add a new custom product data tabs to the product page, following instructions from the WooCommerce docs:
https://docs.woocommerce.com/document/editing-product-data-tabs/
After I updated functions.php new tabs ar not visible oin my product page
Is there some additional thing to do, or some action to activate new tab?– I edited functions.php in the child theme (active) per instructions.
– Renaming and hiding other product tabs is working – changes are visible in the products.
– When I inserted code to add new tab, file was updated without errors or warnings, and no related info in the logs.
– When I opened one of the already existing products, new tab was not visible.
– Tab did not exist in the page html code
– When editing existing products, or creating new products, I did not find option to add New tab.
– woo_tabs module also did not have option for new tab.Child theme functions.php code:
(when I printed out $tabs in the example bellow, the printout contained the info on new tabs)<?php add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' ); function woo_new_product_tab( $tabs ) { // Adds the facts tab $tabs['facts_tab'] = array( 'title' => __( 'Facts', 'woocommerce' ), 'priority' => 12, 'callback' => 'woo_new_product_tab_content_1' ); // Adds the facts tab $tabs['knowledge_tab'] = array( 'title' => __( 'Did you know?', 'woocommerce' ), 'priority' => 15, 'callback' => 'woo_new_product_tab_content_2' ); //print_r( $tabs ); return $tabs; } function woo_new_product_tab_content_1() { // The new tab content echo 'The Facts'; echo 'Some facts about the product'; } function woo_new_product_tab_content_2() { // The new tab content echo 'Did you know?'; echo 'Some fun tidbits about the product'; }
- The topic ‘New added product tabs not visible on products page’ is closed to new replies.