diff --git a/plugins/woocommerce/changelog/46321-update-hide-banner-from-preview b/plugins/woocommerce/changelog/46321-update-hide-banner-from-preview new file mode 100644 index 00000000000..4cb9f0fe9f9 --- /dev/null +++ b/plugins/woocommerce/changelog/46321-update-hide-banner-from-preview @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Hide coming soon banner from LYS preview frame \ No newline at end of file diff --git a/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php b/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php index c76a845be81..09ca19607df 100644 --- a/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php +++ b/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php @@ -230,6 +230,11 @@ class LaunchYourStore { * - 'woocommerce_coming_soon' option value must be 'yes' */ public function maybe_add_coming_soon_banner_on_frontend() { + // Do not show the banner if the site is being previewed. + if ( isset( $_GET['site-preview'] ) ) { // @phpcs:ignore + return false; + } + // User must be an admin or editor. // phpcs:ignore if ( ! current_user_can( 'shop_manager' ) && ! current_user_can( 'administrator' ) ) {