Skip to content

Instantly share code, notes, and snippets.

@daveloodts
Created March 14, 2022 09:56
Show Gist options
  • Save daveloodts/a00f1130e2fc9453c9729811edb44f44 to your computer and use it in GitHub Desktop.
Save daveloodts/a00f1130e2fc9453c9729811edb44f44 to your computer and use it in GitHub Desktop.
WooCommerce afhaal tekst in mails
function action_woocommerce_email_customer_details( $order, $sent_to_admin, $plain_text, $email ) {
if ( $email->id == 'customer_processing_order' && $order->has_shipping_method( 'local_pickup' ) ) {
echo __( '<strong>U ontvangt een mailtje wanneer uw bestelling klaarligt.</strong><br/><br+>', 'woocommerce' );
// For 'completed'
} elseif( $email->id == 'customer_completed_order' && $order->has_shipping_method( 'local_pickup' ) ) {
echo __( '<strong>Uw bestelling ligt klaar. <a href="https://www.vanlommelprinting.be/contact/">Bekijk onze openingsuren</a></strong><br/><br/>', 'woocommerce' );
}
}
add_action( 'woocommerce_email_before_order_table', 'action_woocommerce_email_customer_details', 10, 4 );
function bbloomer_change_processing_email_subject( $subject, $order ) {
if ( $order->has_shipping_method( 'local_pickup' ) ) {
$subject = 'Uw bestelling ligt klaar voor afhaal';
return $subject;
}
else {
$subject = 'Uw bestelling is verzonden.';
return $subject;
}
}
add_filter( 'woocommerce_email_subject_customer_completed_order', 'bbloomer_change_processing_email_subject', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment