Last active
October 16, 2019 17:59
-
-
Save dancameron/e30ab76b69bab78cfbbcef61b917d300 to your computer and use it in GitHub Desktop.
Set default values for line items
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 // don't add this line since it's already in your functions.php file | |
| function si_rate_default( $columns = array(), $type ) { | |
| if ( '' != $type || 'default' != $type ) { | |
| return $columns; | |
| } | |
| $columns['rate']['value'] = 125; | |
| $columns['qty']['value'] = 1; | |
| $columns['tax']['value'] = 0; | |
| $columns['total']['value'] = 125; | |
| return $columns; | |
| } | |
| add_filter( 'si_line_item_columns', 'si_rate_default', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This snippet is a customization for Sprout Invoices. A customizable solution that provides a way for you to get paid via your WordPress site. For more information please don't hesitate to reach out.