Skip to content

Instantly share code, notes, and snippets.

@xadapter
Forked from Nishadup/function.php
Last active March 12, 2020 10:20
Show Gist options
  • Save xadapter/5cedc5aa882e8c96e75a39f3350d162d to your computer and use it in GitHub Desktop.
Save xadapter/5cedc5aa882e8c96e75a39f3350d162d to your computer and use it in GitHub Desktop.
Snippet to translate the WooCommerce shipment tracking text. Supports PluginHive Shipping Plugins: https://www.pluginhive.com/product-category/woocommerce-plugin/woocommerce-shipping/
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