Home Forums WoodMart support forum Add custom tab with short description

Add custom tab with short description

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #50995

    wzd24
    Participant

    I add a custom tab to product detail page with functions.php in childtheme.
    Now i try to add the product short description to this tab.
    But how?

    In functions.php we add

    // extra Tab for short description
    add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
    function woo_new_product_tab( $tabs ) {
    	// Adds the new tab
    	$tabs['test_tab'] = array(
    		'title' 	=> __( 'SHORTDESCRIPTION', 'woocommerce' ),
    		'priority' 	=> 15,
    		'callback' 	=> 'woo_new_product_tab_content'
    	);
    	return $tabs;
    }

    And now i try to add shortdescription to this tab:

    function woo_new_product_tab_content() {
    	// The new tab content
    	WHICH ELEMENT NAME TO ENTER HERE TO GET THE SHORT DESCRIPTION?
    }

    Can you help me please with this line?
    I dont know what is the command line to get the short description.

    Best wishes

    #51008

    Artem Temos
    Keymaster

    Hi,

    Here is a code to display the short description

    function woo_new_product_tab_content() {
        the_excerpt();
    }

    Regards

Viewing 2 posts - 1 through 2 (of 2 total)