December 13, 2016 at 5:37 pm
Hi again !
I have made a few customizations on the single product page, using hooks so that it stays compatible with woocommerce or theme updates.
The goal is to display the title above both the page and the sidebar (like in fullwidth page template for instance).
I have put the following code in my functions.php
function change_product_page_order() {
if (is_product()) {
//var_dump($product);
/** Move Product Title above page */
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
add_action( 'woocommerce_before_main_content', 'woocommerce_template_single_title', 10 );
}
}
add_action('wp','change_product_page_order');
It shows the title and breadcrumbs (+ the horizontal line below) above the product image and the short description, but not fullwidth (the sidebar displays next to it)
See *Login to see link
I’ve tried changing the priority of the hook, like add_action( 'woocommerce_before_main_content', 'woocommerce_template_single_title', 5 ); but it breaks the title alignment, and does not solve the problem for the sidebar…
*Login to see link
Can you give me any help with what I’m missing ?
Thanks in advance.