WooCommerce: Send Email to Admin Every 3 Hours (Cron Job)

This snippet consists of many WooCommerce tasks: setting up a “WordPress Cron Job” (i.e. schedule a hook that runs on a specific time interval), getting the WooCommerce completed orders from the database, and finally sending a simple email to the store admin.

Complex, but as usual you can simply copy/paste and re-adapt it to your unique specifications. For example, I’m using it to send a survey email to each customer who has placed an order. There are thousands of applications, so this is just the start. Enjoy! Continue reading WooCommerce: Send Email to Admin Every 3 Hours (Cron Job)

WooCommerce: Send a Custom Email on Order Status Change

If you use custom WooCommerce order statuses, or wish to target an order status transition that is not default (e.g. when order goes from “Processing” to “Completed”, the Completed email triggers – but what if you want to target a transition from “Processing” to “Custom Status”?), sending custom emails is quite complex.

First of all, they won’t show under WooCommerce > Settings > Emails (unless you code it, true) – second, no email will trigger. So, how do they do it?

Continue reading WooCommerce: Send a Custom Email on Order Status Change

WooCommerce: Don’t Send Emails for Free Orders

There are times when you sell free products to give customers access to a membership, an online course, or for other reasons. In these cases, you might not want to send the “Order Completed” email or get the “New Order” transactional notification, so that you can avoid sending and receiving hundreds of emails.

Of course, you’d still want to keep the order emails for amounts above $0. Here’s the fix.

Continue reading WooCommerce: Don’t Send Emails for Free Orders

WooCommerce: How to Add a Custom Checkout Field

Let’s imagine you want to add a custom checkout field (and not an additional billing or shipping field) on the WooCommerce Checkout page. For example, it might be a customer licence number – this has got nothing to do with billing and nothing to do with shipping.

Ideally, this custom field could show above the Checkout page order notes – right after the shipping form. It will feature a label, an input field, and will be required.

So, here’s how you do it – hope it helps you understand that anything is possible with WooCommerce!

Continue reading WooCommerce: How to Add a Custom Checkout Field

WooCommerce: Add Content to a Specific Order Email

Customizing WooCommerce emails via the WordPress dashboard is not easy and – sometimes – not possible. For example, you can’t edit or add content to them unless you’re familiar with code.

Well, here’s a quick example to learn how to add content to any WooCommerce default order email. In this case study, our goal is showing an upsell to get buyers to go back to the website and buy with a coupon code. Enjoy!

Continue reading WooCommerce: Add Content to a Specific Order Email