Skip to content

Commit

Permalink
do not enqueue woopay checkout scripts on product pages
Browse files Browse the repository at this point in the history
  • Loading branch information
frosso committed May 16, 2024
1 parent de28d7f commit 3ce38af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/woopay-user/class-woopay-save-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) ) {
Expand Down

0 comments on commit 3ce38af

Please sign in to comment.