Skip to content

Instantly share code, notes, and snippets.

@Nishadup
Created October 9, 2017 14:07
Show Gist options
  • Save Nishadup/b87b05c5e3a021f1d92926b0ceb42fd2 to your computer and use it in GitHub Desktop.
Save Nishadup/b87b05c5e3a021f1d92926b0ceb42fd2 to your computer and use it in GitHub Desktop.
Snippet to translate Tracking text.
add_filter('wf_custom_tracking_message', 'update_tracking_message', 10, 3);
function update_tracking_message($current_msg, $language, $order){
$wpml_language = get_post_meta( $order, 'wpml_language', true);
if( $wpml_language == 'fr-ca' ){
return "Votre commande a été expédiée le [DATE] via [SERVICE]. Pour suivre les envois, veuillez suivre le lien correspondant aux numéros d'expédition [ID]";
}else{
return "Your order was shipped on [DATE] via [SERVICE]. To track shipment, please follow the link(s) [ID]";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment