Skip to content

Instantly share code, notes, and snippets.

@lcenine
lcenine / gist:ad1d0d10070a7ad262e446eae27229cb
Created May 8, 2019 17:47
Fix Woocommerce issue with USPS and -100% Price Adjustment.
function find_free( $rates, $package ) {
// Make sure rate is available
if ( isset( $rates['usps:D_FIRST_CLASS'] ) ) {
// Go ahead and change the label to display something as $0.00 dollars does not populate. It just says USPS by default.
$rates['usps:D_FIRST_CLASS']->label = "USPS - FREE SHIPPING";
// Set the cost to 0.
$rates ['usps:D_FIRST_CLASS']->cost = 0;