Use a hook or filter, or overwrite this Gamipress function?

Turns out it was as simple as adding this line to my function: $current_total_points = gamipress_get_user_points( $user_id, $points_type); and then passing $points – $current_total_points to Gamipress’s insert user earnings function. function ofc_insert_user_earning_on_import_points_tool( $user_id, $points, $points_type, $args ) { if( ! defined( ‘DOING_AJAX’ ) ) return; if( ! DOING_AJAX ) return; if( ! isset( $_REQUEST[‘action’] ) … Read more

How to alter taxes amounts when updating an order

Well, I succeeded in filtering the output of the totals : add_filter( ‘woocommerce_order_get_tax_totals’, ‘filter_function_name_1942’, 10, 2 ); function filter_function_name_1942( $tax_totals, $order ){ foreach( $tax_totals as $single_tax_key => $single_tax_value ){ if( $single_tax_value->rate_id == 1){ $tax_totals[$single_tax_key]->amount = 1000; $tax_totals[$single_tax_key]->formatted_amount = wc_price(‘1000′); } } return $tax_totals; } It’s just an example with hardcoded values, but it works. The … Read more