Last active
September 18, 2024 08:03
-
-
Save HeyMehedi/aba365e12695d9fdb1188069991e32d9 to your computer and use it in GitHub Desktop.
Get Numbers of Orders after completing purchase for specific product
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
| // Hook into EDD's purchase completion action | |
| add_action( 'edd_complete_purchase', 'my_custom_complete_purchase', 10, 1 ); | |
| function my_custom_complete_purchase( $payment_id ) { | |
| // Count Completed Payments | |
| $completed_orders = edd_count_payments( [ | |
| 'status' => 'publish', | |
| 'download' => 131665, | |
| ] ); | |
| error_log( ' $completed_orders->complete : ' . print_r( $completed_orders->complete, true ) ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment