Usage:
This shortcode enables you to display a list of invoices to your subscribers, based on the currently logged in user.
By using different parameter combinations, this shortcode can be used to display different views of the invoices on file in your system, such as the “invoicetype” filter set to “all”, “product” or “subscription” invoices.
With the “status” filter, you can choose “all”, “paid” or “unpaid”.
You can also specify which fields you want included in the table display. The “official” list of accepted field names can be found here.
In addition to the table fields, the shortcode also makes one additional “field” available to you:
- “Balance“, which is a virtual or computed field, showing the difference between the invoice total and the amount(s) paid,
You can specify your own headers for each column. If you choose not to, the shortcode will use the field names from the invoice table.
This shortcode does NOT supports conditional branching with [ELSE_list_invoices].
Shortcode nesting is NOT supported.
Parameters:
invoice_type | Can be ‘all’, ‘product’ or ‘subscription’. Please note that only the first character is needed, ‘a’, ‘p’ or ‘s’. Required: No, defaults to ‘all’. |
status | Is used to filter the list based on “paid” status. Can be ‘all, ‘paid’ or ‘unpaid’. Please not that only the first character is needed. Required: No, defaults to ‘all’. columns: Is used to specify the fields to be used for the column values. These can be: Id, ContactId, DateCreated, InvoiceTotal, TotalPaid, TotalDue, PayStatus, CreditStatus, RefundStatus, PayPlanStatus, AffiliateId, LeadAffiliateId, PromoCode, InvoiceType, Description, ProductSold, Synced, Balance, ProductName, ProductType. Required: No. Default: ‘Id, Description, DateCreated, InvoiceTotal, TotalPaid, TotalDue, RefundStatus, Balance’. |
columns | Is used to specify the fields to be used for the column values. These can be: Id, ContactId, DateCreated, InvoiceTotal, TotalPaid, TotalDue, PayStatus, CreditStatus, RefundStatus, PayPlanStatus, AffiliateId, LeadAffiliateId, PromoCode, InvoiceType, Description, ProductSold, Synced, Balance, ProductName, ProductType. Required: No. Default: ‘Id, Description, DateCreated, InvoiceTotal, TotalPaid, TotalDue, RefundStatus, Balance’. |
headers | Is used to specify columns headers for the generate table. The fields to be used for the column values. Required: No, defaults to the default column names. |
Example:
[i4w_list_invoices] Used this way, the shortcode will run with pre-established defaults (see parameters below).
[i4w_list_invoices invoice_type='all'] The shortcode will use defaults and will produce a list of "product" and "subscription" invoices (Note: this is the default behavior and need not be specified).
[i4w_list_invoices invoice_type='product'] The shortcode will use defaults but will only produce a list of "product" invoices.
[i4w_list_invoices invoice_type='subscription'] The shortcode will use defaults but will only produce a list of "subscription" invoices.
[i4w_list_invoices invoice_type='all' status='all'] The shortcode will use defaults and will produce a list of "product" and "subscription" invoices, both "paid" and "unpaid" (Note: this is the default behavior and need not be specified).
[i4w_list_invoices invoice_type='product' status='paid'] The shortcode will use defaults but will only produce a list of "PAID" "product" invoices.
[i4w_list_invoices invoice_type='subscription' status='unpaid'] The shortcode will use defaults but will only produce a list of "UNPAID" "subscription" invoices.
[i4w_list_invoices columns='DateCreated,InvoiceTotal,TotalPaid'] By using the "columns" parameter, you can specify fields other than the defaults (see parameters below). In this (example) case, the list would only consist of three columns. In addition to the three "virtual" fields listed above, the list of acceptable field names from you which you can choose is: Id, ContactId, DateCreated, InvoiceTotal, TotalPaid, TotalDue, PayStatus, CreditStatus, RefundStatus, PayPlanStatus, AffiliateId, LeadAffiliateId, PromoCode, InvoiceType, Description, ProductSold, Synced.
[i4w_list_invoices columns='DateCreated,InvoiceTotal,TotalPaid' headers='Date,Total,Paid'] By specifying "headers", the shortcode will use those as column headers instead of the field (columns) names.