Skip to content

Instantly share code, notes, and snippets.

@claudiosanches
Last active September 5, 2017 16:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claudiosanches/9d0d1a0808da3dd8994421b6e457e903 to your computer and use it in GitHub Desktop.
Save claudiosanches/9d0d1a0808da3dd8994421b6e457e903 to your computer and use it in GitHub Desktop.
WooCommerce Correios - Free PAC when cart costs more than 100
<?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