email-notifications

Set a Tracking Number link on customer email notifications in Woocommerce 3

这一生的挚爱 提交于 2019-12-08 06:51:06
问题 I've managed to get this together and now I'm trying to make the number that is being entered into the custom field (saved to the order) to be linked in the order email. Here's the code: // create the metabox add_action( 'add_meta_boxes', 'bdev_add_postnord_meta_box' ); if ( ! function_exists( 'bdev_add_postnord_meta_box' ) ) { function bdev_add_postnord_meta_box() { add_meta_box( 'postnord_field', __('PostNord Parcel ID','woocommerce'), 'bdev_add_postnord_for_tracking', 'shop_order', 'side',

Remove woocommerce complete or processing email based on order meta

那年仲夏 提交于 2019-12-08 06:15:30
问题 I am trying to remove the processing (or complete) email based on some order meta. I'm using a POS system and getting customers to pay via the customer invoice email - the initial order status is pending payment. I want to a) test if the order was made using the pos, b) remove either the "processing" or "complete" email. I can't seem to get the if statement logic to work. I'm pretty sure the meta key is '_pos' and the value is '1' or '0'. Here's my myphp screem shot of wp_postmeta add_action(

Custom message on completed order status email notification only for customer user role

梦想与她 提交于 2019-12-08 05:49:01
问题 I would like to improve this code from this answer, to display a message on completed order status emails only for customers, but not for other user roles (as subscribers, etc...). Here is that code: add_action( 'woocommerce_email_before_order_table', 'completed_order_mail_message', 20 ); function completed_order_mail_message( $order ) { if ( empty( $order->get_used_coupons() ) && $order->post_status == 'wc-completed' ) echo '<h2 id="h2thanks">Get 20% off</h2><p id="pthanks">Thank you for

Customize formatted billing full name with a custom field in Woocommerce emails

两盒软妹~` 提交于 2019-12-08 05:24:29
问题 On one of my websites I use the Flexible Checkout Fields for WooCommerce to make 20 custom fields. Two of them needed to be a select/dropdown field. I wasn't able to do so via the plugin (didn't want to pay for it. Regret that decision now. It is horrible); so I used the first-name and last-name default tags from WooCommerce to make them into a select field. I use them to select the Mr/Mrs title before the name. The emails now only show the first-name and last-name fields, as where I would

Stop specific customer email notification based on payment methods in Woocommerce

こ雲淡風輕ζ 提交于 2019-12-08 04:55:49
问题 In Woocommerce, I need to stop email notifications sent to the customer when order place except when payment_method is BACS (Direct bank transfer). I tried following in my active theme's function.php file: add_filter( 'woocommerce_email_recipient_customer_on_hold_order_order', 'customer_order_email_if_bacs', 10, 2 ); function customer_order_email_if_bacs( $recipient, $order ) { if( $order->payment_method() !== 'bacs' ) $recipient = ''; return $recipient; } But it don't work. Any help is

Send Woocommerce Order to email address listed on product page

家住魔仙堡 提交于 2019-12-08 03:40:29
问题 I'm using Woocommerce and the Product Addons plugin to add extra fields to a product. One of those fields is an email address to let people send the confirmation of the order to a DIFFERENT address than the billing address shown on the checkout page. Emails should be sent to both addresses. Any thoughts on maybe how to modify the functions.php file to do this? 回答1: In the woocommerce_email_recipient_{$this->id} filter hook, you can use the $order argument to get your 2nd email. But first Lets

Add a pdf attachment to WooCommerce completed order email notification

一曲冷凌霜 提交于 2019-12-08 02:20:31
问题 Found this code on another thread but can't make it work. PDF uploaded to wp-content/child-theme/. Goal is to attach the pdf to the completed order emails that woocommerce will send out. Not sure if customer_completed_order is correct? add_filter( 'woocommerce_email_attachments', 'attach_terms_conditions_pdf_to_email', 10, 3 ); function attach_terms_conditions_pdf_to_email ( $attachments , $email_id, $email_object ) { // Avoiding errors and problems if ( ! is_a( $order, 'WC_Order' ) || !

Display order customer note in Woocommerce email notifications

橙三吉。 提交于 2019-12-07 20:48:43
问题 In Woocommerce, I am trying to get the customers additional order message: I am trying to display that customer message on the email notifications. But i don't know how to get this information in the php code. Here is my code in the functions.php file: add_action( 'woocommerce_email_after_order_table', 'ts_email_after_order_table', 10, 4 ); function ts_email_after_order_table( $item_id, $item, $order, $plain_text){ $notes=$order->customer_message; //did not work echo '<table cellspacing="0"

Disable email notification for WooCommerce manual/edit orders

吃可爱长大的小学妹 提交于 2019-12-07 17:07:29
问题 WooCommerce expertise needed I need to disable email notifications for orders that I create manually, I have to use the processing status, I can't create a custom status because of a custom hook for the processing order status. Ideally a checkbox in the manual order page that could be ticked and when it is ticked it will disable email from sending to the customer at every status. (processing - completed). Reason is that ebay orders have to be entered into the backend orders for database

Display product custom fields as order items in Woocommerce 3

无人久伴 提交于 2019-12-07 11:52:33
问题 In Woocommerce, I use custom fields to calculate the price of a product, based on this code - Set a calculated price for variable products in the WooCommerce. Thanks for the help LoicTheAztec. // Add a custom field before single add to cart add_action( 'woocommerce_before_add_to_cart_button', 'custom_product_price_field', 5 ); function custom_product_price_field(){ echo '<div class="custom-text text"> <h3>Rental</h3> <label>Start Date:</label> <input type="date" name="rental_date" value=""