Created
November 24, 2021 18:54
-
-
Save lukecav/4e6eb7aebe87a70c7a0681a36621e084 to your computer and use it in GitHub Desktop.
Disable Stripe scripts from loading on product and cart pages in WooCommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( ‘wc_stripe_load_scripts_on_product_page_when_prbs_disabled’, ‘__return_false’ ); | |
add_filter( ‘wc_stripe_load_scripts_on_cart_page_when_prbs_disabled’, ‘__return_false’ ); |
Unfortunately this no longer works. Any update?
@mihaiav This does wok, but note the curly quotes in the snippet. They need to be changed to regular ' quotes.
add_filter( 'wc_stripe_load_scripts_on_product_page_when_prbs_disabled', '__return_false' ); add_filter( 'wc_stripe_load_scripts_on_cart_page_when_prbs_disabled', '__return_false' );
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://wordpress.org/support/topic/multiple-stripe-js-files-slowing-down-single-products-pages/
woocommerce/woocommerce-gateway-stripe#2065