Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

This blog is part of 1 Tute Sets.

WooCommerce Tips and Tricks
1 3 next
  • Customise a product tab in woocommerce using 'woocommerce_product_tabs' action hook

    • 1
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 411
    Comment on it

    Hello Friends,

    The below code will help you to Customize a product tab in woo commerce using 'woocommerce_product_tabs' action hook, first you have to replace the description tab with a custom function.

      <?php
        add_filter( 'woocommerce_product_tabs', 'woo_findnerd_custom_description_tab', 8 );
        function woo_findnerd_custom_description_tab( $destabs ) {
         $destabs['description']['callback'] = 'woo_findnerd_custom_description_tab_content'; // description callback with custom function
         return $destabs;
        }
        function woo_findnerd_custom_description_tab_content() {
         echo '<h1>TYPE YOUR TITLE Here</h1>'; //
         echo '<p>TYPE YOUR DESCRIPTION HERE </p>'; //
        }
    ?>
    

    In above code we are replacing default product description with our custom description.

    Here woocommerce_product_tabs is an action hook function of woocommerce which holds product tab of woocommerce.
    And woo_findnerd_custom_description_tab is a user defined function that you can change it according to your wish.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: