Okay, I think I’m making progress so far.
add_action('woocommerce_calculate_totals', 'teste');
function teste(){
global $wc_payment_discounts;
if (isset($_POST['shipping_method'])){
$metodo = $_POST['shipping_method'];
if ($metodo[0] == 'local_delivery'){
remove_action( 'woocommerce_calculate_totals', array( $wc_payment_discounts, 'add_discount' ) );
remove_action( 'woocommerce_review_order_before_order_total', array( $wc_payment_discounts, 'discount_display' ) );
}
}
}
But still, $wc_payment_discounts is returning NULL, I guess I’m missing something vital right there.