Created
January 15, 2025 06:17
-
-
Save rajeshsingh520/891299acccc953b66a60a6a809c2a817 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
add_filter( 'woocommerce_package_rates', function ( $rates ){ | |
$match = 'pisol_extended_flat_shipping'; | |
$our_rate = []; | |
foreach ( $rates as $rate_id => $rate ) { | |
if(strpos($rate_id, 'pisol_extended_flat_shipping') !== false){ | |
$our_rate[$rate_id] = $rate; | |
unset($rates[$rate_id]); | |
} | |
} | |
if(!empty($our_rate)){ | |
return array_merge($our_rate, $rates); | |
} | |
return $rates; | |
}, PHP_INT_MAX ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment