Instantly share code, notes, and snippets.

Embed
What would you like to do?
Filter Kurir Rajaongkir pada Plugin Ongkos Kirim
<?php
add_filter('pok_rates', 'filter_rajaongkir_courier', 10, 2);
function filter_rajaongkir_courier($rates, $package) {
$filtered_rates = array();
$selected_courier = array(
'JNE - REG',
'JNE - OKE',
'JNE - YES'
);
foreach ($rates as $r) {
if (in_array($r['class'], $selected_courier)) {
$filtered_rates[] = $r;
}
}
return $filtered_rates;
}
?>
@gamaup

This comment has been minimized.

Copy link
Owner

gamaup commented Apr 28, 2017

Sesuaikan $selected_courier dengan nama layanan yang dikehendaki. Pilihan nama-nama layanan bisa dilihat dengan cara mencoba melakukan checkout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment