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 include this line in your functions.php, since it already starts with it. | |
| function _change_status_of_invoice_submission( SI_Invoice $invoice ) { | |
| $invoice->set_status( 'publish' ); | |
| } | |
| add_action( 'si_gravity_forms_integration_invoice_created', '_change_status_of_invoice_submission' ); | |
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 include this line in your functions.php, since it already starts with it. | |
| function _round_sa_formatted_money( $money, $orig_amount, $doc_id ) { | |
| $doc = si_get_doc_object( $doc_id ); | |
| if ( '' == $doc ) { | |
| return $money; | |
| } |
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 | |
| /** | |
| * Updated the method to make sure the vars are being passed. | |
| */ | |
| public static function setAppInfo( $appName, $appVersion = null, $appUrl = null, $appPartnerId = null ) { | |
| error_log( 'vars: ' . print_r( get_defined_vars(), true ) ); | |
| self::$appInfo = self::$appInfo ?: []; | |
| self::$appInfo['name'] = $appName; | |
| self::$appInfo['partner_id'] = $appPartnerId; |
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 include this line in your functions.php, since it already starts with it. | |
| function _custom_get_month_options() { | |
| $months = array( | |
| '01' => __( '01 - January', 'sprout-invoices' ), | |
| '02' => __( '02 - February', 'sprout-invoices' ), | |
| '03' => __( '03 - March', 'sprout-invoices' ), | |
| '04' => __( '04 - April', 'sprout-invoices' ), | |
| '05' => __( '05 - May', 'sprout-invoices' ), | |
| '06' => __( '06 - June', 'sprout-invoices' ), |
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 include this line in your functions.php, since it already starts with it. | |
| function _override_load_textdomain_for_si( $bool = false, $domain = '', $mofile = '' ) { | |
| if ( 'sprout-invoices' == $domain ) { | |
| return true; | |
| } | |
| return $bool; | |
| } | |
| add_filter( 'override_load_textdomain', '_override_load_textdomain_for_si', 3 ); |
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 include this line in your functions.php, since it already starts with it. | |
| // remove action within SI add-on | |
| remove_action( 'si_invoice_status_updated', array( 'Woo_Payments_Integration', 'maybe_change_order_status' ), 10, 2 ); | |
| // recreate action with processing status | |
| function maybe_change_order_status( SI_Invoice $invoice, $status = '' ) { | |
| $order_id = get_post_meta( $invoice->get_id(), self::ORDER_ID_META, true ); | |
| if ( ! $order_id ) { |
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 include this line in your functions.php, since it already starts with it. | |
| remove_action( 'woocommerce_thankyou', array( 'SI_Woo_Payment_Processor', 'redirect_to_invoice_after_payment' ) ); | |
| add_filter( 'si_woopay_redirect_back_to_invoice', '__return_false' ); |
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 include this line in your functions.php, since it already starts with it. | |
| function _send_user_password( $args = array() ) { | |
| $args['user_pass'] = wp_generate_password(); | |
| return $args; | |
| } | |
| add_filter( 'si_create_user_args', '_send_user_password' ); |
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 include this line in your functions.php, since it already starts with it. | |
| switch ( SI_Client_Categories::get_client_type( si_get_client_id() ) ) { | |
| case 'client-type-slug1': | |
| "do something"; | |
| break; | |
| case 'client-type-slug2': | |
| "do something for this slug"; | |
| break; | |
| default: |
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 your functions.php file already starts with it. | |
| /** | |
| * Example filter will translate/change the string "Description". | |
| * "Description" can be changed to whatever string you'd like to translate/change | |
| * just make sure to change the function name so you don't have any conflicts. | |
| */ | |
| function si_change_strings( $translations, $text, $domain ) { | |
| if ( 'sprout-invoices' === $domain ) { | |
| // Change "Description" |