diff --git a/inc/compatibility/woocommerce.php b/inc/compatibility/woocommerce.php index bb474214c2..89a82c02f1 100644 --- a/inc/compatibility/woocommerce.php +++ b/inc/compatibility/woocommerce.php @@ -284,8 +284,13 @@ public function register_hooks() { add_action( 'admin_footer', array( $this, 'update_woo_width' ) ); // Wrap content. - add_action( 'neve_after_primary_start', array( $this, 'wrap_pages_start' ) ); - add_action( 'neve_before_primary_end', array( $this, 'wrap_pages_end' ) ); + if ( function_exists( 'elementor_theme_do_location' ) && elementor_theme_do_location( 'header' ) ) { + add_action( 'woocommerce_before_main_content', array( $this, 'wrap_pages_start' ) ); + add_action( 'woocommerce_after_main_content', array( $this, 'wrap_pages_end' ) ); + } else { + add_action( 'neve_after_primary_start', array( $this, 'wrap_pages_start' ) ); + add_action( 'neve_before_primary_end', array( $this, 'wrap_pages_end' ) ); + } add_action( 'woocommerce_before_main_content', array( $this, 'wrap_main_content_start' ), 15 ); add_action( 'woocommerce_after_main_content', array( $this, 'close_div' ), 15 );