diff --git a/plugins/woocommerce/changelog/46561-update-LYS-remove-old-template-files b/plugins/woocommerce/changelog/46561-update-LYS-remove-old-template-files
new file mode 100644
index 00000000000..b7772fe8873
--- /dev/null
+++ b/plugins/woocommerce/changelog/46561-update-LYS-remove-old-template-files
@@ -0,0 +1,4 @@
+Significance: patch
+Type: update
+Comment: Edits previously unreleased feature
+
diff --git a/plugins/woocommerce/includes/admin/settings/class-wc-settings-advanced.php b/plugins/woocommerce/includes/admin/settings/class-wc-settings-advanced.php
index 16985529930..6df71562bf8 100644
--- a/plugins/woocommerce/includes/admin/settings/class-wc-settings-advanced.php
+++ b/plugins/woocommerce/includes/admin/settings/class-wc-settings-advanced.php
@@ -135,25 +135,6 @@ class WC_Settings_Advanced extends WC_Settings_Page {
'autoload' => false,
),
- Features::is_enabled( 'launch-your-store' ) ? array(
- 'title' => __( 'Coming soon page', 'woocommerce' ),
- 'desc' => __( 'TBD', 'woocommerce' ),
- 'id' => 'woocommerce_coming_soon_page_id',
- 'type' => 'single_select_page_with_search',
- 'default' => '',
- 'class' => 'wc-page-search',
- 'css' => 'min-width:300px;',
- 'args' => array(
- 'exclude' =>
- array(
- wc_get_page_id( 'checkout' ),
- wc_get_page_id( 'myaccount' ),
- ),
- ),
- 'desc_tip' => true,
- 'autoload' => false,
- ) : array(),
-
array(
'type' => 'sectionend',
'id' => 'advanced_page_options',
diff --git a/plugins/woocommerce/src/Admin/API/Options.php b/plugins/woocommerce/src/Admin/API/Options.php
index f979ea62cbf..7adab2c3046 100644
--- a/plugins/woocommerce/src/Admin/API/Options.php
+++ b/plugins/woocommerce/src/Admin/API/Options.php
@@ -226,7 +226,6 @@ class Options extends \WC_REST_Data_Controller {
'woocommerce_private_link',
'woocommerce_share_key',
'woocommerce_show_lys_tour',
- 'woocommerce_coming_soon_page_id',
// WC Test helper options.
'wc-admin-test-helper-rest-api-filters',
'wc_admin_helper_feature_values',
diff --git a/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php b/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php
index 550ecc8d4fa..0fcc361c71e 100644
--- a/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php
+++ b/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php
@@ -14,7 +14,6 @@ class LaunchYourStore {
*/
public function __construct() {
add_action( 'woocommerce_update_options_site-visibility', array( $this, 'save_site_visibility_options' ) );
- add_action( 'current_screen', array( $this, 'maybe_create_coming_soon_page' ) );
if ( is_admin() ) {
add_filter( 'woocommerce_admin_shared_settings', array( $this, 'preload_settings' ) );
}
@@ -39,10 +38,6 @@ class LaunchYourStore {
'woocommerce_private_link' => array( 'yes', 'no' ),
);
- if ( isset( $_POST['woocommerce_store_pages_only'] ) ) {
- $this->possibly_update_coming_soon_page( wc_clean( wp_unslash( $_POST['woocommerce_store_pages_only'] ) ) );
- }
-
$at_least_one_saved = false;
foreach ( $options as $name => $option ) {
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
@@ -58,135 +53,6 @@ class LaunchYourStore {
}
}
- /**
- * Update the contents of the coming soon page on settings change. Do not update if the post request
- * doesn't change the store pages only setting, if the setting is unchanged, or if the page has been edited.
- *
- * @param string $next_store_pages_only The next store pages only setting.
- * @return void
- */
- public function possibly_update_coming_soon_page( $next_store_pages_only ) {
- $option_name = 'woocommerce_store_pages_only';
- $current_store_pages_only = get_option( $option_name, null );
-
- // If the current and next store pages only values are the same, return.
- if ( $current_store_pages_only && $current_store_pages_only === $next_store_pages_only ) {
- return;
- }
-
- $page_id = get_option( 'woocommerce_coming_soon_page_id' );
- $page = get_post( $page_id );
- $original_page_content = 'yes' === $current_store_pages_only
- ? $this->get_store_only_coming_soon_content()
- : $this->get_entire_site_coming_soon_content();
-
- // If the page exists and the content is not the same as the original content, its been edited from its original state. Return early to respect any changes.
- if ( $page && $page->post_content !== $original_page_content ) {
- return;
- }
-
- if ( $page_id ) {
- $next_page_content = 'yes' === $next_store_pages_only
- ? $this->get_store_only_coming_soon_content()
- : $this->get_entire_site_coming_soon_content();
- wp_update_post(
- array(
- 'ID' => $page_id,
- 'post_content' => $next_page_content,
- )
- );
-
- $template_id = 'yes' === $next_store_pages_only
- ? 'coming-soon-store-only'
- : 'coming-soon-entire-site';
- update_post_meta( $page_id, '_wp_page_template', $template_id );
- }
- }
-
- /**
- * Create a pattern for the store only coming soon page.
- *
- * @return string
- */
- public function get_store_only_coming_soon_content() {
- $heading = __( 'Great things coming soon', 'woocommerce' );
- $subheading = __( 'Something big is brewing! Our store is in the works - Launching shortly!', 'woocommerce' );
-
- return sprintf(
- '
-
-
-
-
-
-
%s
-
-
-
-
-
-
-
-
%s
-
-
-
-
-
- ',
- $heading,
- $subheading
- );
- }
-
- /**
- * Create a pattern for the entire site coming soon page.
- *
- * @return string
- */
- public function get_entire_site_coming_soon_content() {
- $heading = __( 'Pardon our dust! We\'re working on something amazing -- check back soon!', 'woocommerce' );
-
- return sprintf(
- '
-
-
%s
-
- ',
- $heading
- );
- }
-
- /**
- * Add `coming soon` page when it hasn't been created yet.
- *
- * @param WP_Screen $current_screen Current screen object.
- *
- * @return void
- */
- public function maybe_create_coming_soon_page( $current_screen ) {
- $option_name = 'woocommerce_coming_soon_page_id';
- $current_page = PageController::get_instance()->get_current_page();
- $is_home = isset( $current_page['id'] ) && 'woocommerce-home' === $current_page['id'];
- $page_id_option = get_option( $option_name, false );
- if ( $current_screen && 'woocommerce_page_wc-admin' === $current_screen->id && $is_home && ! $page_id_option ) {
- $store_pages_only = 'yes' === get_option( 'woocommerce_store_pages_only', 'no' );
- $page_id = wc_create_page(
- esc_sql( _x( 'Coming Soon', 'Page slug', 'woocommerce' ) ),
- $option_name,
- _x( 'Coming Soon', 'Page title', 'woocommerce' ),
- $store_pages_only ? $this->get_store_only_coming_soon_content() : $this->get_entire_site_coming_soon_content(),
- );
- $template_id = $store_pages_only ? 'coming-soon-store-only' : 'coming-soon-entire-site';
- update_post_meta( $page_id, '_wp_page_template', $template_id );
- // wc_create_page doesn't create options with autoload = yes.
- // Since we'll querying the option on WooCommerce home,
- // we should update the option to set autoload to yes.
- $page_id_option = get_option( $option_name );
- update_option( $option_name, $page_id_option, true );
- }
- }
-
/**
* Preload settings for Site Visibility.
*
@@ -239,13 +105,6 @@ class LaunchYourStore {
return false;
}
- // No need to show the banner on the Coming soon page itself.
- $page_id = get_the_ID();
- $coming_soon_page_id = intval( get_option( 'woocommerce_coming_soon_page_id' ) );
- if ( $page_id === $coming_soon_page_id ) {
- return false;
- }
-
$link = admin_url( 'admin.php?page=wc-settings#wc_settings_general_site_visibility_slotfill' );
$text = sprintf(
diff --git a/plugins/woocommerce/src/Blocks/BlockTemplatesRegistry.php b/plugins/woocommerce/src/Blocks/BlockTemplatesRegistry.php
index f975284c950..594de3bc5b5 100644
--- a/plugins/woocommerce/src/Blocks/BlockTemplatesRegistry.php
+++ b/plugins/woocommerce/src/Blocks/BlockTemplatesRegistry.php
@@ -47,8 +47,6 @@ class BlockTemplatesRegistry {
CartTemplate::SLUG => new CartTemplate(),
CheckoutTemplate::SLUG => new CheckoutTemplate(),
ComingSoonTemplate::SLUG => new ComingSoonTemplate(),
- ComingSoonEntireSiteTemplate::SLUG => new ComingSoonEntireSiteTemplate(),
- ComingSoonStoreOnlyTemplate::SLUG => new ComingSoonStoreOnlyTemplate(),
OrderConfirmationTemplate::SLUG => new OrderConfirmationTemplate(),
SingleProductTemplate::SLUG => new SingleProductTemplate(),
);
diff --git a/plugins/woocommerce/src/Blocks/Templates/ComingSoonEntireSiteTemplate.php b/plugins/woocommerce/src/Blocks/Templates/ComingSoonEntireSiteTemplate.php
deleted file mode 100644
index 29008d0faca..00000000000
--- a/plugins/woocommerce/src/Blocks/Templates/ComingSoonEntireSiteTemplate.php
+++ /dev/null
@@ -1,56 +0,0 @@
-get_placeholder_page();
- return null !== $placeholder && $post instanceof \WP_Post && $placeholder->post_name === $post->post_name;
- }
-}
diff --git a/plugins/woocommerce/src/Blocks/Templates/ComingSoonStoreOnlyTemplate.php b/plugins/woocommerce/src/Blocks/Templates/ComingSoonStoreOnlyTemplate.php
deleted file mode 100644
index a45beb62e34..00000000000
--- a/plugins/woocommerce/src/Blocks/Templates/ComingSoonStoreOnlyTemplate.php
+++ /dev/null
@@ -1,56 +0,0 @@
-get_placeholder_page();
- return null !== $placeholder && $post instanceof \WP_Post && $placeholder->post_name === $post->post_name;
- }
-}
diff --git a/plugins/woocommerce/src/Blocks/Templates/ComingSoonTemplate.php b/plugins/woocommerce/src/Blocks/Templates/ComingSoonTemplate.php
index 0811ecc540c..de791dce4c7 100644
--- a/plugins/woocommerce/src/Blocks/Templates/ComingSoonTemplate.php
+++ b/plugins/woocommerce/src/Blocks/Templates/ComingSoonTemplate.php
@@ -39,8 +39,7 @@ class ComingSoonTemplate extends AbstractPageTemplate {
* @return \WP_Post|null Post object or null.
*/
protected function get_placeholder_page() {
- $page_id = get_option( 'woocommerce_coming_soon_page_id' );
- return $page_id ? get_post( $page_id ) : null;
+ return null;
}
/**
@@ -49,8 +48,6 @@ class ComingSoonTemplate extends AbstractPageTemplate {
* @return boolean
*/
protected function is_active_template() {
- global $post;
- $placeholder = $this->get_placeholder_page();
- return null !== $placeholder && $post instanceof \WP_Post && $placeholder->post_name === $post->post_name;
+ return false;
}
}
diff --git a/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php b/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php
index 323610bbd9b..264fafcdf4f 100644
--- a/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php
+++ b/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php
@@ -298,8 +298,6 @@ class BlockTemplateUtils {
public static function get_template_paths( $template_type ) {
$wp_template_filenames = array(
'archive-product.html',
- 'coming-soon-entire-site.html',
- 'coming-soon-store-only.html',
'coming-soon.html',
'order-confirmation.html',
'page-cart.html',
diff --git a/plugins/woocommerce/src/Internal/ComingSoon/ComingSoonCacheInvalidator.php b/plugins/woocommerce/src/Internal/ComingSoon/ComingSoonCacheInvalidator.php
index 5b1a0297073..a2101519adf 100644
--- a/plugins/woocommerce/src/Internal/ComingSoon/ComingSoonCacheInvalidator.php
+++ b/plugins/woocommerce/src/Internal/ComingSoon/ComingSoonCacheInvalidator.php
@@ -29,12 +29,12 @@ class ComingSoonCacheInvalidator {
* Temporary solution to invalidate the WordPress.com Edge Cache. We can trigger
* invalidation by publishing any post. It should be refactored with a supported integration.
*/
- $coming_soon_page_id = get_option( 'woocommerce_coming_soon_page_id' ) ?? null;
- if ( $coming_soon_page_id ) {
+ $cart_page_id = get_option( 'woocommerce_cart_page_id' ) ?? null;
+ if ( $cart_page_id ) {
// Re-publish the coming soon page. Has the side-effect of invalidating the Edge Cache.
wp_update_post(
array(
- 'ID' => $coming_soon_page_id,
+ 'ID' => $cart_page_id,
'post_status' => 'publish',
)
);
diff --git a/plugins/woocommerce/templates/templates/blockified/coming-soon-entire-site.html b/plugins/woocommerce/templates/templates/blockified/coming-soon-entire-site.html
deleted file mode 100644
index 19f4c7f4a46..00000000000
--- a/plugins/woocommerce/templates/templates/blockified/coming-soon-entire-site.html
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/woocommerce/templates/templates/blockified/coming-soon-store-only.html b/plugins/woocommerce/templates/templates/blockified/coming-soon-store-only.html
deleted file mode 100644
index 781eac1c2d2..00000000000
--- a/plugins/woocommerce/templates/templates/blockified/coming-soon-store-only.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/plugins/woocommerce/templates/templates/coming-soon-entire-site.html b/plugins/woocommerce/templates/templates/coming-soon-entire-site.html
deleted file mode 100644
index 19f4c7f4a46..00000000000
--- a/plugins/woocommerce/templates/templates/coming-soon-entire-site.html
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/woocommerce/templates/templates/coming-soon-store-only.html b/plugins/woocommerce/templates/templates/coming-soon-store-only.html
deleted file mode 100644
index 781eac1c2d2..00000000000
--- a/plugins/woocommerce/templates/templates/coming-soon-store-only.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/plugins/woocommerce/tests/php/includes/settings/class-wc-settings-advanced-test.php b/plugins/woocommerce/tests/php/includes/settings/class-wc-settings-advanced-test.php
index 0983e7e20a4..81233fe1f03 100644
--- a/plugins/woocommerce/tests/php/includes/settings/class-wc-settings-advanced-test.php
+++ b/plugins/woocommerce/tests/php/includes/settings/class-wc-settings-advanced-test.php
@@ -108,7 +108,6 @@ class WC_Settings_Advanced_Test extends WC_Settings_Unit_Test_Case {
'woocommerce_myaccount_payment_methods_endpoint' => 'text',
'woocommerce_myaccount_lost_password_endpoint' => 'text',
'woocommerce_logout_endpoint' => 'text',
- 'woocommerce_coming_soon_page_id' => 'single_select_page_with_search',
);
if ( $site_is_https ) {
diff --git a/plugins/woocommerce/tests/php/src/Internal/ComingSoon/ComingSoonRequestHandlerTest.php b/plugins/woocommerce/tests/php/src/Internal/ComingSoon/ComingSoonRequestHandlerTest.php
index 26208995efb..0b6c9f3ba11 100644
--- a/plugins/woocommerce/tests/php/src/Internal/ComingSoon/ComingSoonRequestHandlerTest.php
+++ b/plugins/woocommerce/tests/php/src/Internal/ComingSoon/ComingSoonRequestHandlerTest.php
@@ -31,7 +31,6 @@ class ComingSoonRequestHandlerTest extends \WC_Unit_Test_Case {
public function test_coming_soon_mode_shown_to_visitor() {
$this->markTestSkipped( 'The die statement breaks the test. To be improved.' );
update_option( 'woocommerce_coming_soon', 'yes' );
- update_option( 'woocommerce_coming_soon_page_id', 99 );
$wp = new \WP();
$wp->request = '/';
do_action_ref_array( 'parse_request', array( &$wp ) );
@@ -45,7 +44,6 @@ class ComingSoonRequestHandlerTest extends \WC_Unit_Test_Case {
public function test_live_mode_shown_to_visitor() {
$this->markTestSkipped( 'The die statement breaks the test. To be improved.' );
update_option( 'woocommerce_coming_soon', 'no' );
- update_option( 'woocommerce_coming_soon_page_id', 99 );
$wp = new \WP();
$wp->request = '/';
do_action_ref_array( 'parse_request', array( &$wp ) );
@@ -59,7 +57,6 @@ class ComingSoonRequestHandlerTest extends \WC_Unit_Test_Case {
public function test_shop_manager_exclusion() {
$this->markTestSkipped( 'Failing in CI but not locally. To be investigated.' );
update_option( 'woocommerce_coming_soon', 'yes' );
- update_option( 'woocommerce_coming_soon_page_id', 99 );
$user_id = $this->factory->user->create(
array(
'role' => 'shop_manager',