From f2a8c7fe3621f047b74f2ec7c549d44f09747b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alba=20Rinc=C3=B3n?= Date: Tue, 19 Mar 2024 11:52:55 +0100 Subject: [PATCH] [CYS] Update the woo.com themes link to include the back url (#45661) * Update the woo.com theme link to include the back url * Encode url to avoid losing the path param * Add changefile(s) from automation for the following project(s): woocommerce * Fix lint error --------- Co-authored-by: github-actions --- .../changelog/45661-45377-update-cys-theme-link | 4 ++++ plugins/woocommerce/src/Admin/API/OnboardingThemes.php | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 plugins/woocommerce/changelog/45661-45377-update-cys-theme-link diff --git a/plugins/woocommerce/changelog/45661-45377-update-cys-theme-link b/plugins/woocommerce/changelog/45661-45377-update-cys-theme-link new file mode 100644 index 00000000000..7eac7d74efd --- /dev/null +++ b/plugins/woocommerce/changelog/45661-45377-update-cys-theme-link @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +[CYS] Update the woo.com themes link to include the back url \ No newline at end of file diff --git a/plugins/woocommerce/src/Admin/API/OnboardingThemes.php b/plugins/woocommerce/src/Admin/API/OnboardingThemes.php index b047cb9febf..2b21e335028 100644 --- a/plugins/woocommerce/src/Admin/API/OnboardingThemes.php +++ b/plugins/woocommerce/src/Admin/API/OnboardingThemes.php @@ -249,6 +249,9 @@ class OnboardingThemes extends \WC_REST_Data_Controller { ); } + $in_app_purchase_params = \WC_Admin_Addons::get_in_app_purchase_url_params(); + $in_app_purchase_params['wccom-back'] = rawurlencode( '/wp-admin/admin.php?page=wc-admin&path=/customize-store' ); + $core_themes = array( array( 'name' => 'Twenty Twenty-Four', @@ -308,7 +311,7 @@ class OnboardingThemes extends \WC_REST_Data_Controller { 'total_palettes' => 9, 'slug' => 'highline', 'thumbnail_url' => 'https://woo.com/wp-content/uploads/2023/12/Featured-image-538x403-1.png', - 'link_url' => 'https://woo.com/products/highline/', + 'link_url' => add_query_arg( $in_app_purchase_params, 'https://woo.com/products/highline/' ), ), array( 'name' => 'Luminate', @@ -338,7 +341,7 @@ class OnboardingThemes extends \WC_REST_Data_Controller { 'total_palettes' => 5, 'slug' => 'luminate', 'thumbnail_url' => 'https://woo.com/wp-content/uploads/2022/07/Featured-image-538x403-2.png', - 'link_url' => 'https://woo.com/products/luminate/', + 'link_url' => add_query_arg( $in_app_purchase_params, 'https://woo.com/products/luminate/' ), ), array( 'name' => 'Nokul', @@ -368,7 +371,7 @@ class OnboardingThemes extends \WC_REST_Data_Controller { 'total_palettes' => 6, 'slug' => 'nokul', 'thumbnail_url' => 'https://woo.com/wp-content/uploads/2022/11/Product-logo.jpg', - 'link_url' => 'https://woo.com/products/nokul/', + 'link_url' => add_query_arg( $in_app_purchase_params, 'https://woo.com/products/nokul/' ), ), );