Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Created July 26, 2023 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clifgriffin/1701917c0908af3aefd61b2c71f8c642 to your computer and use it in GitHub Desktop.
Save clifgriffin/1701917c0908af3aefd61b2c71f8c642 to your computer and use it in GitHub Desktop.
Disable CheckoutWC express checkout buttons when autoship is active
<?php
add_action( 'cfw_checkout_customer_info_tab', function () {
if ( function_exists( 'autoship_cart_has_valid_autoship_items' ) && autoship_cart_has_valid_autoship_items() ) {
remove_action( 'cfw_checkout_customer_info_tab', 'cfw_payment_request_buttons', 10 );
}
}, 0 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment