Last active
December 27, 2025 08:57
-
-
Save ivanweiler/1e07bcd08900a7ed9a5d7ec12019b79c to your computer and use it in GitHub Desktop.
woocommerce-complete-for-virtual-products-example.php
This file contains hidden or 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 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