From 762c2ef92405e068d0ae37b67c969248b94593d2 Mon Sep 17 00:00:00 2001
From: RJ <27843274+rjchow@users.noreply.github.com>
Date: Thu, 14 Dec 2023 11:13:08 +0800
Subject: [PATCH] add: easyship to shipping task for AU, NZ, SG, HK (#41852)
---
.../shipping_partners/easyship-column.svg | 68 +++++++++++++++++++
.../images/shipping_partners/easyship-row.svg | 1 +
...add-update-shipping-task-partners-dec-2023 | 4 ++
.../OnboardingTasks/Tasks/Shipping.php | 2 +-
.../DefaultShippingPartners.php | 44 +++++++++++-
.../src/Internal/Admin/Homescreen.php | 2 +-
.../onboarding-tasks/tasks/shipping.php | 2 -
7 files changed, 118 insertions(+), 5 deletions(-)
create mode 100644 plugins/woocommerce/assets/images/shipping_partners/easyship-column.svg
create mode 100644 plugins/woocommerce/assets/images/shipping_partners/easyship-row.svg
create mode 100644 plugins/woocommerce/changelog/add-update-shipping-task-partners-dec-2023
diff --git a/plugins/woocommerce/assets/images/shipping_partners/easyship-column.svg b/plugins/woocommerce/assets/images/shipping_partners/easyship-column.svg
new file mode 100644
index 00000000000..c8879c0a36c
--- /dev/null
+++ b/plugins/woocommerce/assets/images/shipping_partners/easyship-column.svg
@@ -0,0 +1,68 @@
+
diff --git a/plugins/woocommerce/assets/images/shipping_partners/easyship-row.svg b/plugins/woocommerce/assets/images/shipping_partners/easyship-row.svg
new file mode 100644
index 00000000000..ea6945a4990
--- /dev/null
+++ b/plugins/woocommerce/assets/images/shipping_partners/easyship-row.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/plugins/woocommerce/changelog/add-update-shipping-task-partners-dec-2023 b/plugins/woocommerce/changelog/add-update-shipping-task-partners-dec-2023
new file mode 100644
index 00000000000..6185c1adb86
--- /dev/null
+++ b/plugins/woocommerce/changelog/add-update-shipping-task-partners-dec-2023
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Added Easyship promotion to shipping task for AU, NZ, SG, HK. Removed SkydropX.
diff --git a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Shipping.php b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Shipping.php
index c985e22ac90..7935ada2e92 100644
--- a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Shipping.php
+++ b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Shipping.php
@@ -122,7 +122,7 @@ class Shipping extends Task {
return true;
}
- return in_array( $store_country, array( 'CA', 'AU', 'GB', 'ES', 'IT', 'DE', 'FR', 'MX', 'CO', 'CL', 'AR', 'PE', 'BR', 'UY', 'GT', 'NL', 'AT', 'BE' ), true );
+ return in_array( $store_country, array( 'CA', 'AU', 'NZ', 'SG', 'HK', 'GB', 'ES', 'IT', 'DE', 'FR', 'CL', 'AR', 'PE', 'BR', 'UY', 'GT', 'NL', 'AT', 'BE' ), true );
}
return self::has_physical_products();
diff --git a/plugins/woocommerce/src/Admin/Features/ShippingPartnerSuggestions/DefaultShippingPartners.php b/plugins/woocommerce/src/Admin/Features/ShippingPartnerSuggestions/DefaultShippingPartners.php
index d5806baa6b4..17536e031dd 100644
--- a/plugins/woocommerce/src/Admin/Features/ShippingPartnerSuggestions/DefaultShippingPartners.php
+++ b/plugins/woocommerce/src/Admin/Features/ShippingPartnerSuggestions/DefaultShippingPartners.php
@@ -99,7 +99,7 @@ class DefaultShippingPartners {
'description' => '',
'learn_more_link' => 'https://wordpress.org/plugins/skydropx-cotizador-y-envios/',
'is_visible' => array(
- self::get_rules_for_countries( array( 'MX', 'CO' ) ),
+ self::get_rules_for_countries( array() ), // No countries eligible for SkydropX promotion at this time.
),
'available_layouts' => array( 'column' ),
),
@@ -117,6 +117,48 @@ class DefaultShippingPartners {
),
'available_layouts' => array( 'column' ),
),
+ array(
+ 'name' => 'Easyship',
+ 'slug' => 'easyship-woocommerce-shipping-rates',
+ 'description' => __( 'Simplified shipping with: ', 'woocommerce' ),
+ 'layout_column' => array(
+ 'image' => $asset_base_url . 'easyship-column.svg',
+ 'features' => $column_layout_features,
+ ),
+ 'layout_row' => array(
+ 'image' => $asset_base_url . 'easyship-row.svg',
+ 'features' => array(
+ array(
+ 'icon' => $check_icon,
+ 'description' => __( 'Highly discounted shipping rates', 'woocommerce' ),
+ ),
+ array(
+ 'icon' => $check_icon,
+ 'description' => __(
+ 'Seamless order sync and label printing',
+ 'woocommerce'
+ ),
+ ),
+ array(
+ 'icon' => $check_icon,
+ 'description' => __( 'Branded tracking experience', 'woocommerce' ),
+ ),
+ array(
+ 'icon' => $check_icon,
+ 'description' => __( 'Built-in Tax & Duties paperwork', 'woocommerce' ),
+ ),
+ array(
+ 'icon' => $check_icon,
+ 'description' => __( 'Free Plan Available', 'woocommerce' ),
+ ),
+ ),
+ ),
+ 'learn_more_link' => 'https://woo.com/products/easyship-shipping-rates/',
+ 'is_visible' => array(
+ self::get_rules_for_countries( array( 'SG', 'HK', 'AU', 'NZ' ) ),
+ ),
+ 'available_layouts' => array( 'row', 'column' ),
+ ),
array(
'name' => 'Sendcloud',
'slug' => 'sendcloud-shipping',
diff --git a/plugins/woocommerce/src/Internal/Admin/Homescreen.php b/plugins/woocommerce/src/Internal/Admin/Homescreen.php
index 1830d90d1a5..3356ed5c67f 100644
--- a/plugins/woocommerce/src/Internal/Admin/Homescreen.php
+++ b/plugins/woocommerce/src/Internal/Admin/Homescreen.php
@@ -126,7 +126,7 @@ class Homescreen {
if (
( 'US' === $country_code && $is_jetpack_installed )
||
- ( ! in_array( $country_code, array( 'CA', 'AU', 'GB', 'ES', 'IT', 'DE', 'FR', 'MX', 'CO', 'CL', 'AR', 'PE', 'BR', 'UY', 'GT', 'NL', 'AT', 'BE' ), true ) )
+ ( ! in_array( $country_code, array( 'CA', 'AU', 'NZ', 'SG', 'HK', 'GB', 'ES', 'IT', 'DE', 'FR', 'CL', 'AR', 'PE', 'BR', 'UY', 'GT', 'NL', 'AT', 'BE' ), true ) )
||
( 'US' === $country_code && false === $is_jetpack_installed && false === $is_wcs_installed )
) {
diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/features/onboarding-tasks/tasks/shipping.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/features/onboarding-tasks/tasks/shipping.php
index ef89f442f6c..9db22e524eb 100644
--- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/features/onboarding-tasks/tasks/shipping.php
+++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/features/onboarding-tasks/tasks/shipping.php
@@ -157,8 +157,6 @@ class WC_Admin_Tests_OnboardingTasks_Task_Shipping extends WC_Unit_Test_Case {
array( 'IT' ),
array( 'DE' ),
array( 'FR' ),
- array( 'MX' ),
- array( 'CO' ),
array( 'CL' ),
array( 'AR' ),
array( 'PE' ),