diff --git a/includes/woopay-user/class-woopay-save-user.php b/includes/woopay-user/class-woopay-save-user.php index 78096190fba..b7b09be0f44 100644 --- a/includes/woopay-user/class-woopay-save-user.php +++ b/includes/woopay-user/class-woopay-save-user.php @@ -36,6 +36,10 @@ public function __construct() { * Load scripts and styles for checkout page. */ public function register_checkout_page_scripts() { + if ( ! is_checkout() || ! has_block( 'woocommerce/checkout' ) ) { + return; + } + // Don't enqueue checkout page scripts when WCPay isn't available. $gateways = WC()->payment_gateways->get_available_payment_gateways(); if ( ! isset( $gateways['woocommerce_payments'] ) ) {