Lianne
Lianne

Reputation: 41

Move product description after short description in Woocommerce

I've used the first option of this hook (the other ones didn't work) -> Woocommerce Product Default Description for All Products

And this is how it looks (the red marked text is the standard description)

However, I want the text to appear after the product description. where the red arrow is, I want the standard text. So above 'in winkelmand' (which means 'add to bag')

How can I achieve this?

Upvotes: 4

Views: 9883

Answers (2)

LoicTheAztec
LoicTheAztec

Reputation: 254492

This can be done with the following code (commented):

// 1. Remove the description product tab
add_filter( 'woocommerce_product_tabs', 'remove_descrip_product_tab', 98 );
function remove_descrip_product_tab( $tabs ) {
    // Remove the description tab
    unset( $tabs['description'] );

    return $tabs;
}

// 2. Add the product description after the product short description
add_action( 'woocommerce_single_product_summary', 'my_custom_action', 25 );
function my_custom_action() {
    global $post;

    // Product description output
    echo '<div class="product-post-content">' . get_the_content() . '</div>'; 
}

Code goes in function.php file of your active child theme (or active theme). Tested and works.

Upvotes: 6

LadyLuck
LadyLuck

Reputation: 53

That one did not work for me either, so I kept looking and found this one, which worked perfectly

// Move Description to Under Price WooCommerce

    function woocommerce_template_product_description() {wc_get_template( 'single-product/tabs/description.php' );}

    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_product_description', 20 );

Upvotes: 5

Related Questions