Last active
September 5, 2017 16:08
-
-
Save claudiosanches/9d0d1a0808da3dd8994421b6e457e903 to your computer and use it in GitHub Desktop.
WooCommerce Correios - Free PAC when cart costs more than 100
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 | |
function custom_woocommerce_correios_shipping_methods( $rate ) { | |
if ( isset( WC()->cart->subtotal ) && 100 <= WC()->cart->subtotal ) { | |
$rate['cost'] = 0; | |
} | |
return $rate; | |
} | |
add_filter( 'woocommerce_correios_correios-pac_rate', 'custom_woocommerce_correios_shipping_methods' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment