Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save xlplugins/073b6541bb016971d37656793179cee2 to your computer and use it in GitHub Desktop.

Select an option

Save xlplugins/073b6541bb016971d37656793179cee2 to your computer and use it in GitHub Desktop.
Disable new user creation email during the checkout if cart contain sublium subscription
add_filter( 'woocommerce_email_enabled_customer_new_account', function( $enabled, $object ) {
      // Check if we're in a checkout/order processing context with a Sublium plan in cart
      if ( WC()->cart && \Sublium_WCS\Includes\Main\Cart::get_instance()->cart_contains_plan() ) {
          return false;
      }
      return $enabled;
  }, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment