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 Hook: Content get’s displayed twice and not AFTER the order total
- Have I got this IF Statement correct?
- WooCommerce Price Filter not working? [closed]
- How to replace WooCommerce Product Gallery Trigger icon using PHP/CSS? [closed]
- get woocommerce product image url and price from database [closed]
- Trying to style Woocommerce sidebar Cart Widget [closed]
- Cancelled orders move to Trash automatically in Woocommerce – how to disable?
- Adding Field in WooCommerce
- Woocommerce Sort by default variation price
- Add Name and SKU Main Product to Secondary Product to Cart
- Conditional logic – if product has a parent category, echo this
- WooCommerce set default product sort to product description (content) [closed]
- Synchronise Renewals on existing subscriptions [closed]
- Add rewrite rule to make Woocommerce product category page seo friendly
- How to show the urls inside the simple product when the customer buys it?
- Custom template – query issues
- Prices showed without decimals separator on BACKEND. Weight/price not working on Wocommerce
- add the attribute value above the english product title
- How to add woocommerce products header title in woocommerce_breadcrumb hook to function.php
- Can I create categories or attribute contain more than 70,000?
- Format decimals of get_price_html
- apply_filter and add_filter conflict
- Combine one action and one filter
- How to run code when cookie is added?
- Return product list based on current product attribute
- Getting in an exception for get product detail by id in woocommerce REST api
- How to make wocommerce shop products same heigt
- Woocommerce Ajax add to cart redirect to homepage
- WooCommerce – Remove automaticly added membership product if user remove regular product from cart
- Temporary access to page with URL sent to email
- How to save a Woocomerce metabox input as a metadata field
- Product related to post by title
- How do you programatically add a booking item to the cart?
- populating extra field with woocommerce categories
- Woocommerce Shop Manager Capabilities
- customize src attribute in woocommerce single product image
- How to tell woocommerce slider to use thumbnails
- Add customer name to woocommerce email-header.php heading
- woocommerce sort by dropdown styling
- Mysql query – amount spent by customer
- How to change the link of product menu from wordpress admin panel
- Get value from an input field and pass into update_meta_data as $meta_value
- bulk media crop for featured images
- Users credentials and syncing from third party with WooCommerce
- Woocommerce custom product with JS script, can’t understand how it works [closed]
- Rename woocommerce button [closed]
- Create templates from attributes for categories
- How do I get slug of term by his name?
- Include customer details in woocommerce 3rd part plugin email
- how to add a page to a plugin?
- Titles with thumbnails in media library
- additional fields based on the quantity of products selected
- limit all products
- Pricing Rules plugin bulk table not showing in varition of products (have 2 attributes) if single attribute its shows
- WooCommerce Webhook Action When a New Product Review was Submitted/Created