Created
December 3, 2025 11:38
-
-
Save xlplugins/60671cb0000d9f4c476ef8e9c031cf5b to your computer and use it in GitHub Desktop.
Paypal official invoice id format change
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
| <?php | |
| add_filter('wfocu_ppcp_gateway_invoice_id', 'modify_invoice_id_for_paypal', 10, 3); | |
| function modify_invoice_id_for_paypal($invoice_id, $order, $prefix) { | |
| // Get the WooCommerce order ID | |
| $order_id = $order->get_id(); | |
| // Modify the invoice ID format to "UWC-<order_id>" | |
| $invoice_id = 'UWC-' . $order_id; | |
| return $invoice_id; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment