Created
August 30, 2017 06:31
-
-
Save gedex/0e444c1026604416ba8cad8ebaf4be6e to your computer and use it in GitHub Desktop.
Override rule cost for distance shipping when destination within 5miles of shop AND order total over $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 | |
add_filter( 'woocommerce_distance_rate_shipping_rule_cost_distance_shipping', function( $rule_cost, $rule, $distance, $package ) { | |
$order_total = $package['contents_cost']; | |
if ( $order_total > 100 && $distance <= 5 ) { | |
$rule_cost = 0; | |
} | |
return $rule_cost; | |
}, 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible?