Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Change Melhor Envio shipping methods labels.
function test_methods_array(){
return [
'wpmelhorenvio_Correios_PAC' => 'Encomenda normal',
'wpmelhorenvio_Correios_EXPRESSO' => 'Encomenda expressa',
'wpmelhorenvio_JadLog_.Com' => 'JadLog Bar',
'wpmelhorenvio_JadLog_.Package' => 'JadLog Foo',
add_filter('woocommerce_package_rates', function($rates, $package){
$methods_map = test_methods_array();
foreach ($rates as $key => $rate) {
if(!in_array($key, array_keys($methods_map))) {
$method_label = $methods_map[$key];
return $rates;
}, 10, 2);

This comment has been minimized.

Copy link
Owner Author

CasperBraske commented Mar 27, 2018


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.