Try this instead:
add_action( "woocommerce_email_after_order_table", "my_woocommerce_email_after_order_table", 10, 1);
function my_woocommerce_email_after_order_table( $order ) {
$my_gift_wrap_checkbox = get_post_meta( $order->id, "my_gift_wrap_checkbox", true );
$gift_wrap = $my_gift_wrap_checkbox ? 'Yes please!' : 'No thank you.';
echo '<p><strong>Gift wrap?: </strong>' . $gift_wrap . '</p>';
if ( $my_gift_wrap_checkbox ) {
echo '<p><strong>Gift wrap instructions: </strong>' . get_post_meta( $order->id, "my_gift_wrap_field", true ) . '</p>';
}
}
Related Posts:
- WooCommerce lost password reset flow not working with SendGrid (redirect loop)
- Preventing WooCommerce email sending only on particular conditions
- woocommerce fail to replace template string in email title [closed]
- Editing Header Titles of each details in woocommerce Order Email [closed]
- Woocommerce : How to attach an custom attachment with customer-processing-order.php email template [closed]
- WooCommerce email text based on category && shipping zone && payment method [closed]
- WooCommerce: Email Notifications
- woocommerce_email_attachments filter arguments [closed]
- WordPress ‘on behalf of’ email
- WooCommerce: The model of e-mail is displaying only the html, not css [closed]
- How do I hide the purchase note in the WooCommerce ‘order completed’ email?
- Add custom order meta to Order Completed email
- Woocommerce: Prevent sending of email when order is “Completed”
- How to add a user custom field into Woocommerce emails?
- Custom Admin Email Subject for Woocommerce (3.8.0) Orders
- WooCommerce order complete email logic
- woocommerce email template detect email recipient
- Adding extra email address who receives email like admin – woocommerce
- Add shipping address to Woocommerce order emails [closed]
- Send email notifications to a defined email address depending if a product in order has a specific TAG [closed]
- Woocommerce emails from gmail not being sent
- Send admin new order email to logged in user as well
- Create new email in WooCommerce
- How to check if woocommerce_order_item_name is use in email?
- WordPress woocommerce new order email not working
- Custom Email via Hook only for completed order
- Access custom meta_data in processing order email
- How to add (and change the font of) the short product description to order page and customer’s new order e-mail [closed]
- How to send Woocommerce Customer Details (Name, Email and Phone Number) to Admin upon signup
- How to change lost password email text using custom plugin wordpress?
- Using admin email in billing address
- Forgot password flow does not work, getting email with a link but after clicking link it’s not working
- Send a different “thank you” email based on payment method
- Customer Email Address
- Adding time of order to Admin email for new order
- how to add custom reviews button in woocommerce order complete generated mail
- How to add coupon expiry date into the followup emails?
- Conditional email recipient based off Shipping Method [closed]
- Manual Woocommerce Complete order Emails
- Turkish Character Problem on mailing
- How to override email text New Customer Order?
- Woo-Commerce new order email no style attached
- WooCommerce – How to add a custom field to only a specific email template [closed]
- Insert a custom field as a second email address to a completed order in WooCommerce
- Woocommerce admin order email customize – remove product short description
- Woocommerce: show default variation price is products list?
- display available size on hover, in woocommerce shop page [closed]
- How to filter Post using Meta Data REST API
- Is it possible to recalculate cart prices? [closed]
- Woocommerce: Get Cart ID
- Woocommerce – remove sale price field from dashboard [closed]
- Woocommerce wp-admin search products through custom meta value too
- show shop instead of 404 page for missing products
- if statement for search results
- Woocommerce exclude specific categories products from related products
- Apply a discount percentage to regular price WooCommerce by function
- Add sub subpage endpoint in woocommerce
- Edit WooCommerce product content based on category
- Server-Based CRON Job
- How to incluide custom field in WooCommerce email using placeholder
- Woocommerce: Can’t put items in cart in iframe and on iphone
- Display products by category in Woocommerce cart page?
- Checkout form looks terrible [closed]
- How to upload multiple image using wp_insert_post
- How can i manage total price in checkout page? [closed]
- In WooCommerce product archive, how can you also set the quantity to be added to cart by typing, instead of just by using +/-?
- WooCommerce product category permalinks
- How to do string attachment with wp_mail
- Can’t show most recent comment on top with wp_list_comments() for WooCommerce reviews
- WooCommerce Displaying Price With & Without TAX [closed]
- how do i remove a woo-commerce widget?
- How can I convert woocommerce checkout fields in capital letters
- Order by date on category dynamically – Woocommerce
- Woocomnerce Limit Purchase value before proceed checkout
- Add to cart – button should be disabled
- How To Customize The Product Page Template for a WooCommerce Custom Product Type Plugin [closed]
- Hide Add to Cart button on woocommerce Product description page of a particular product
- What is better way to sync wp multisite woocommerce products
- Remove required from a custom field created from WooCommerce Checkout Field Editor plugin
- How to change status of woocommerce orders when post status is changed
- WooCommerce – Child Category wont show, but Parent does
- How to hide a random text with a div tag using a class on product pages with a specific tag
- Missing variable options on add to cart form
- Woocommerce digital download not working – database error Cannot add or update a child row: a foreign key constraint fails [closed]
- when product out of stock single page show button notify woo-commerce
- Recently viewed products – Order by viewed
- How can i add product Accessories from front-end using custom php form?
- How to save order item custom attributes save into custom table
- Manually create an order with a product ID woocommerce
- WooCommerce subscriptions give option of manual renewal on checkout [closed]
- Change order status after checkout
- Is it safe to update an old site after backing it up and activating a child theme?
- Disable Woocommerce main shop page, but not the product category archive pages
- access Woo commerce | WordPress methods externally
- How to store ACF from product in user_meta?
- Trying to link to a custom css file in a new folder
- Add woocommerce.css in template?
- Add second price option based on payment method at cart item price
- Create WordPress account on different domain when WooCommerce order completed
- Creating a woocommerce order when a user creates an account