Remove the action from it’s hook, then add it to a different hook (corresponding to where you’d like it to display). You can view the available hooks by viewing the WooCommerce single-product.php
and content-single-product.php
template files. Just like it all of WordPress anywhere there is a do_action( 'some_hook_name' )
that signifies an action hook that you can attach functions to. Here is an example (for your functions.php
) that will move the related products output to outside the #product div.
function wpa_115808(){
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
add_action( 'woocommerce_after_single_product', 'woocommerce_output_related_products' );
}
add_action( 'woocommerce_before_main_content', 'wpa_115808' );