How can I move upsells above description?
-
Hello, can you give me a snippet or something like this for move upsells above description?
PS. WooCommerce upsells.
Hello,
Please try using the solution provided in the topic and see if this works for you.
https://xtemos.com/forums/topic/moving-upsells/
Best Regards
Yeah, it’s works for me, but I still have upsales under description.
I used this code:
add_action( 'init', 'move_upsells_after_related' );
function move_upsells_after_related( ) {
remove_action( 'woodmart_before_sidebar_area', 'woocommerce_upsell_display', 20 );
remove_action( 'woodmart_woocommerce_after_sidebar', 'woocommerce_upsell_display', 10 );
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 5 );
}
Hello,
Please try adding the following Custom CSS in the Global Custom CSS area under Theme Settings >> Custom CSS.
.container.related-and-upsells {
display: none;
}
Regards.
Xtemos Studios
Ok, it’s not bad variant, but I still have 2 copes of upsells HTML element. Maybe we have a snippet or something to hide second block?
Hello,
Try to replace your previously added code with the following one
add_action( 'wp', 'move_upsells_after_related', 1010 );
function move_upsells_after_related( ) {
remove_action( 'woodmart_before_sidebar_area', 'woocommerce_upsell_display', 20 );
remove_action( 'woodmart_woocommerce_after_sidebar', 'woocommerce_upsell_display', 10 );
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 5 );
}
Kind Regards