Capabilities

The following capabilities are required to manage invoices delete_wpi_invoice delete_wpi_invoices delete_published_wpi_invoices delete_others_wpi_invoices edit_wpi_invoice edit_wpi_invoices edit_others_wpi_invoices edit_published_wpi_invoices publish_wpi_invoices read_wpi_invoice

Google Analytics Ecommerce Tracking

Google Analytics Ecommerce Tracking allows you to measure the number of transactions and revenue that your website generates. You must have added regular Google Analytics code to the top of your page and you must also have enabled ‘Ecommerce’ on your Google Analytics dashboard. function _wpi_custom_ga_ecommerce_tracking( $invoice ) { if ( ! wpinv_is_success_page() ) { […]

wpinv_get_ip

Filters the IP address of the current visitor. apply_filters( ‘wpinv_get_ip’, string $ip ); Parameters # Returns # $ip (string) Current visitor’s IP address. Examples # Set the current visitor’s IP address from United Kingdom IP address range. It will identify that the current visitor is from United Kingdom. function _wpi_wpinv_get_ip( $ip ) { /* * […]

wpinv_recurring_add_subscription_payment

Fires after a new invoice created for recurring payment. do_action( ‘wpinv_recurring_add_subscription_payment’, WPInv_Invoice $invoice, WPInv_Invoice $parent_invoice, array $subscription_args ); Parameters # $invoice (object) WPInv_Invoice object. $parent_invoice (object) WPInv_Invoice object of parent invoice. $subscription_args (array) The array of subscription data. Examples # Handle event of new invoice created for recurring payment. function _wpi_wpinv_recurring_add_subscription_payment( $invoice, $parent_invoice, $subscription_args ) […]

wpinv_recurring_record_payment

Fires after an recurring payment has been recorded. do_action( ‘wpinv_recurring_record_payment’, int $invoice_id, int $parent_invoice_id, array $subscription_args ); Parameters # $invoice_id (int) The Invoice ID. $parent_invoice_id (int) The Parent Invoice ID. $subscription_args (array) The array of subscription data. Examples # Handle event of recurring payment recorded for the invoice. function _wpi_wpinv_recurring_record_payment( $invoice_id, $parent_invoice_id, $subscription_args ) { […]

wpinv_post_refund_invoice

Fires after an invoice amount has been refunded. do_action( ‘wpinv_post_refund_invoice’, WPInv_Invoice $invoice ); Parameters # $invoice (object) The WPInv_Invoice object. Examples # Simple example to handle refund of invoice amount. function _wpi_wpinv_post_refund_invoice( $invoice ) { // Invoice items $cart_items = $invoice->get_cart_details(); // Refunded amount $refunded_amount = $invoice->get_total(); // Do your stuff here } add_action( ‘wpinv_post_refund_invoice’, […]

wpinv_status_{$old_status}_to_{$new_status}

Fires after an invoice status has been changed from one status to another. do_action( ‘wpinv_status_’ . $old_status . ‘_to_’ . $new_status, int $invoice_id, string $old_status ); $old_status and $new_status, refer to the old and new invoice statuses, respectively. Parameters # $invoice_id (int) The Invoice ID. $old_status (string) Invoice old status. Learn more Examples # Handle […]

wpinv_status_{$new_status}

Fires after an invoice status has been changed from one status to another. do_action( ‘wpinv_status_’ . $new_status, int $invoice_id, string $old_status ); $new_status refer to the new invoice status. Parameters # $invoice_id (int) The Invoice ID. $old_status (string) Invoice old status. Learn more Examples # Handle event on invoice status has been changed to Paid(publish). […]

wpinv_update_status

Fires after an invoice status has been changed from one status to another. do_action( ‘wpinv_update_status’, int $invoice_id, string $new_status, string $old_status ); Parameters # $invoice_id (int) The Invoice ID. $new_status (string) Invoice new status. Learn more $old_status (string) Invoice old status. Learn more Examples # Simple example to handle invoice status has been changed. function […]