diff --git a/modules/ppcp-axo/extensions.php b/modules/ppcp-axo/extensions.php
index e81176244..09b590fd7 100644
--- a/modules/ppcp-axo/extensions.php
+++ b/modules/ppcp-axo/extensions.php
@@ -9,6 +9,7 @@ declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\Axo;
+use WooCommerce\PayPalCommerce\Axo\Helper\NoticeRenderer;
use WooCommerce\PayPalCommerce\Axo\Helper\PropertiesDictionary;
use WooCommerce\PayPalCommerce\Onboarding\State;
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
@@ -82,6 +83,7 @@ return array(
->rule()
->condition_element( 'axo_enabled', '1' )
->action_visible( 'axo_gateway_title' )
+ ->action_visible( 'axo_checkout_config_notice' )
->action_visible( 'axo_privacy' )
->action_visible( 'axo_name_on_card' )
->action_visible( 'axo_style_heading' )
@@ -112,6 +114,18 @@ return array(
),
'classes' => array( 'ppcp-valign-label-middle', 'ppcp-align-label-center' ),
),
+ 'axo_checkout_config_notice' => array(
+ 'heading' => '',
+ 'html' => $container->get( 'axo.checkout-config-notice' ),
+ 'type' => 'ppcp-html',
+ 'classes' => array( 'ppcp-field-indent' ),
+ 'class' => array(),
+ 'screens' => array(
+ State::STATE_ONBOARDED,
+ ),
+ 'requirements' => array( 'dcc', 'axo' ),
+ 'gateway' => array( 'dcc', 'axo' ),
+ ),
'axo_gateway_title' => array(
'title' => __( 'Gateway Title', 'woocommerce-paypal-payments' ),
'type' => 'text',
diff --git a/modules/ppcp-axo/services.php b/modules/ppcp-axo/services.php
index e7a450692..44253f22d 100644
--- a/modules/ppcp-axo/services.php
+++ b/modules/ppcp-axo/services.php
@@ -13,6 +13,7 @@ use WooCommerce\PayPalCommerce\Axo\Assets\AxoManager;
use WooCommerce\PayPalCommerce\Axo\Gateway\AxoGateway;
use WooCommerce\PayPalCommerce\Axo\Helper\ApmApplies;
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
+use WooCommerce\PayPalCommerce\WcGateway\Helper\CartCheckoutDetector;
return array(
@@ -149,4 +150,47 @@ return array(
);
},
+ 'axo.checkout-config-notice' => static function ( ContainerInterface $container ) : string {
+ $checkout_page_link = esc_url( get_edit_post_link( wc_get_page_id( 'checkout' ) ) ?? '' );
+ $block_checkout_docs_link = __(
+ 'https://woocommerce.com/document/cart-checkout-blocks-status/#reverting-to-the-cart-and-checkout-shortcodes',
+ 'woocommerce-paypal-payments'
+ );
+
+ if ( CartCheckoutDetector::has_elementor_checkout() ) {
+ $notice_content = sprintf(
+ /* translators: %1$s: URL to the Checkout edit page. %2$s: URL to the block checkout docs. */
+ __(
+ 'Warning: The Checkout page of your store currently uses the Elementor Checkout widget
. To enable Fastlane and accelerate payments, the page must include either the Classic Checkout
or the [woocommerce_checkout]
shortcode. See this page for instructions on how to switch to the classic layout.',
+ 'woocommerce-paypal-payments'
+ ),
+ esc_url( $checkout_page_link ),
+ esc_url( $block_checkout_docs_link )
+ );
+ } elseif ( CartCheckoutDetector::has_block_checkout() ) {
+ $notice_content = sprintf(
+ /* translators: %1$s: URL to the Checkout edit page. %2$s: URL to the block checkout docs. */
+ __(
+ 'Warning: The Checkout page of your store currently uses the WooCommerce Checkout
block. To enable Fastlane and accelerate payments, the page must include either the Classic Checkout
or the [woocommerce_checkout]
shortcode. See this page for instructions on how to switch to the classic layout.',
+ 'woocommerce-paypal-payments'
+ ),
+ esc_url( $checkout_page_link ),
+ esc_url( $block_checkout_docs_link )
+ );
+ } elseif ( ! CartCheckoutDetector::has_classic_checkout() ) {
+ $notice_content = sprintf(
+ /* translators: %1$s: URL to the Checkout edit page. %2$s: URL to the block checkout docs. */
+ __(
+ 'Warning: The Checkout page of your store does not seem to be properly configured or uses an incompatible third-party Checkout
solution. To enable Fastlane and accelerate payments, the page must include either the Classic Checkout
or the [woocommerce_checkout]
shortcode. See this page for instructions on how to switch to the classic layout.',
+ 'woocommerce-paypal-payments'
+ ),
+ esc_url( $checkout_page_link ),
+ esc_url( $block_checkout_docs_link )
+ );
+ } else {
+ return '';
+ }
+
+ return '
' . $notice_content . '