Posted on

WooCommerce: Disable Customer Order Email 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 this cases, you might not want to send them the “Order Completed” email, as the follow-up work is done by your email marketing software or they are automatically redirected to the resource upon checkout.

Of course, you definitely want to keep the “Order Completed” emails for orders that are not $0. Unfortunately, the method suggested by WooCommerce which “unhooks the emails” cannot be used together with a conditional check (in our case we need to verify if the Order total is $0), so a workaround is needed. Here’s the fix. Continue reading WooCommerce: Disable Customer Order Email for Free Orders

Posted on

WooCommerce: Remove Link to Product @ Order Table

There is a slightly annoying thing on the WooCommerce Thank-You Page and WooCommerce emails. Users looking at the order table can actually click on the Products they just purchased and abandon the page before taking the action you want them to take (see image below).

So, I coded a simple PHP snippet to remove such links. As usual, 1 line of code is more than sufficient:) Continue reading WooCommerce: Remove Link to Product @ Order Table

Posted on

WooCommerce: How to Add CSS to WooCommerce Emails

Unlike your WordPress theme, you can’t just add CSS to your style.css in order to customize the look of the WooCommerce emails.

This handy PHP snippet is therefore the only viable solution. By using the WooCommerce Email Hook Guide, I identified an action called woocommerce_email_header, which is the very first thing that gets called by WooCommerce while “assembling” an email.

By using that hook, we can then echo some CSS that will therefore be applied to every email (note, woocommerce_email_header is a hook that all emails have in common). Continue reading WooCommerce: How to Add CSS to WooCommerce Emails

Posted on

WooCommerce: Add First Name to Email Receipts

Today we take a look at the WooCommerce Emails and specifically at how to change the subject of the Customer Processing Order receipt by adding the billing “First Name”. As usual, this is a matter of 3 lines of code – feel free to copy/paste and customize it to your liking ๐Ÿ™‚ Continue reading WooCommerce: Add First Name to Email Receipts

Posted on

WooCommerce: How to Add Content to a Specific Order Email

A client of mine asked me to add some additional text to the thank you page and the customer order email. In both cases, my client wanted to show an immediate upsell to get buyers to go back to the website and buy again with a coupon code. Continue reading WooCommerce: How to Add Content to a Specific Order Email