Created
December 24, 2025 06:27
-
-
Save pramodjodhani/e297d795908d9abb0442fb5a426bcac3 to your computer and use it in GitHub Desktop.
Iconic WDS - change Fees description to "Collection Fee" for local pickup.
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
| <?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