Last active
November 22, 2020 09:15
-
-
Save Musilda/a84688b8ef4175f66baddebd3055bc5c to your computer and use it in GitHub Desktop.
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 | |
add_filter( 'woocommerce_package_rates', 'musilda_cart_price_free_shipping', 10, 2 ); | |
function musilda_cart_price_free_shipping( $rates, $package ) { | |
if( 1000 < WC()->cart->get_displayed_subtotal() ) { | |
foreach($rates as $key => $item){ | |
$rates[$key]->cost = 0; | |
$rates[$key]->tax = 0; | |
$rates[$key]->taxes = false; | |
} | |
} | |
return $rates; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment