Skip to content

Instantly share code, notes, and snippets.

@pramodjodhani
Created December 24, 2025 06:27
Show Gist options
  • Select an option

  • Save pramodjodhani/e297d795908d9abb0442fb5a426bcac3 to your computer and use it in GitHub Desktop.

Select an option

Save pramodjodhani/e297d795908d9abb0442fb5a426bcac3 to your computer and use it in GitHub Desktop.
Iconic WDS - change Fees description to "Collection Fee" for local pickup.
<?php
/**
* Iconic WDS - change Fees description to "Collection Fee" for local pickup.
*
* @param string $label Label.
*
* @return string
*/
function iconic_wds_update_fee( $label ) {
if ( empty( $_POST['post_data'] ) ) {
return $label;
}
$data = array();
global $iconic_wds;
$chosen_shipping_method = $iconic_wds->get_chosen_shipping_method();
if ( str_contains( $chosen_shipping_method, 'local_pickup' ) || str_contains( $chosen_shipping_method, 'pickup_location' ) ) {
return 'Collection Fee';
}
return $label;
}
add_filter( 'iconic_wds_fee_name', 'iconic_wds_update_fee' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment