0

I'm having a terrible time trying to figure this out. On the single product page in woocommerce, I need to add a sidebar and move the product "summary entry-summary" into that sidebar. Leaving just the product image, and tabs in the main content area. Has anyone done this before or could help me out?

Thanks in advance

1

Checkout the content-single-product.php WooCommerce template for an idea of what functions are hooked where. It is very well commented. When you learn about hooks and filters, all these questions start to become similar.

You'll want to remove the function from it's current hook and add it to a new hook. This sample includes a fake hook destination because I don't know what theme you are using and all themes are different. This is for your functions.php or your child theme's functions.php:

function wpa116854_move_product_excerpt(){
    remove_acton( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
    if(function_exists('woocommerce_template_single_excerpt'))
         add_action( 'your_theme_some_hook', 'woocommerce_template_single_excerpt' );
}
add_action( 'woocommerce_before_single_product', 'wpa116854_move_product_excerpt' );

Replace your_theme_some_hook with the appropriate hook. Or you can add the woocommerce_template_single_excerpt() function directly to your sidebar.php file.

if(function_exists('woocommerce_template_single_excerpt'))
    woocommerce_template_single_excerpt();

Something I wrote a while ago to explain how to manipulate WordPress functions and action hooks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.