This file contains 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 | |
/** | |
* Bulk Refund Orders | |
* | |
* This script expects a csv file with following columns: | |
* - Order ID 1002 | |
* - Reason for refund 'Item was oversold.' | |
* - Amount to refund '34.56' | |
* - Refund payment true/false | |
* - Restock item true/false |
This file contains 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 | |
class SPROUT_order_total { | |
private $orders = []; | |
function __construct() { | |
add_action( "woocommerce_before_order_object_save", [ $this, 'save_order' ], 1000, 2 ); | |
add_filter( "woocommerce_customer_get_total_spent_query", [ $this, 'intercept_query' ], 1000, 2 ); | |
} | |
function intercept_query( $query, $customer ) { |