Skip to content

Instantly share code, notes, and snippets.

@ivanweiler
Last active December 27, 2025 08:57
Show Gist options
  • Select an option

  • Save ivanweiler/1e07bcd08900a7ed9a5d7ec12019b79c to your computer and use it in GitHub Desktop.

Select an option

Save ivanweiler/1e07bcd08900a7ed9a5d7ec12019b79c to your computer and use it in GitHub Desktop.
woocommerce-complete-for-virtual-products-example.php
// add this to the bottom of your theme functions.php file
// wp-content/themes/{your_active_theme}/functions.php
add_filter( 'woocommerce_order_item_needs_processing', function ($virtual_downloadable_item, $product) {
if ( $product->is_virtual() ) { // or check if Gift Card for example by some criteria
return false;
}
return $virtual_downloadable_item;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment