Tagged: x
-
AuthorPosts
-
August 23, 2016 at 7:53 pm #1143999
I am trying to change my WooCommerce product tabs text from “Description” to “Nutritional Information”.
I have added the following code to my functions.php and it’s not working.
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 ); function woo_rename_tabs( $tabs ) { $tabs['description']['title'] = __( 'Nutritional Information' ); // Rename the description tab return $tabs; }
I got the code from: WooCoomerce Docs.
How can I fix this or is there another way to change the tabs name?
Thanks,
Micah
August 23, 2016 at 7:56 pm #1144000This reply has been marked as private.August 23, 2016 at 10:31 pm #1144156I added code to my functions.php to show the Additional Information tab.
The Description tab changed to “Nutritional Information.
I then removed the Additional Information code and reloaded the website.
It’s still showing the Additional Information tab.
I am confused as to what;s going on. This in on my VPS and and don’t have any caching installed on the server or within WordPress. I have cleared my browser cache and tried different browsers. I have also cleared the transients from within the WooCommerce Settings
Here is my current functions.php code.
<?php // ============================================================================= // FUNCTIONS.PHP // ----------------------------------------------------------------------------- // Overwrite or add your own custom functions to X in this file. // ============================================================================= // ============================================================================= // TABLE OF CONTENTS // ----------------------------------------------------------------------------- // 01. Enqueue Parent Stylesheet // 02. Additional Functions // ============================================================================= // Enqueue Parent Stylesheet // ============================================================================= add_filter( 'x_enqueue_parent_stylesheet', '__return_true' ); // Additional Functions // ============================================================================= //Rename WooCommerce Tabs // ============================================================================= add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 ); function woo_rename_tabs( $tabs ) { $tabs['description']['title'] = __( 'Nutritional Information' ); // Rename the description tab return $tabs; } // Change the add to cart button INTO View Product button // ============================================================================= add_filter( 'woocommerce_loop_add_to_cart_link', 'add_product_link' ); function add_product_link( $link ) { global $product; echo '<a href="'.$product->get_permalink( $product->id ).'" class="button">' . __('View Product', 'woocommerce') . '</a>'; }
What am I missing?
Thanks,
Micah
August 24, 2016 at 5:56 am #1144504Hi there,
Please disable ‘Additional information’ tab from Customize -> Woocommerce, please see the attachment.
Hope it helps.
August 25, 2016 at 12:34 am #1146123Thanks for pointing that out to me.
All seems to be the way I want it to be now.
Micah
August 25, 2016 at 3:13 am #1146253You’re welcome, Micah. Glad we could help. 🙂
-
AuthorPosts