Skip to content

Instantly share code, notes, and snippets.

@zarankumar
Created August 18, 2022 12:52
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 zarankumar/0072e03437728849186816c576f83f8b to your computer and use it in GitHub Desktop.
Save zarankumar/0072e03437728849186816c576f83f8b to your computer and use it in GitHub Desktop.
enable pre order for zero orders
function sg_filter_woocommerce_cart_needs_payment( $needs_payment, $cart ) {
// Set true
$needs_payment = true;
return $needs_payment;
}
add_filter( 'woocommerce_cart_needs_payment', 'sg_filter_woocommerce_cart_needs_payment', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment