WooCommerce: Display Required Field Errors “Inline” @ Checkout

If you’re familiar with the upcoming Gutenberg editor, you’ll know there have been a million doubts in regard to accessibility. So, accessibility matters – and WooCommerce has a few issues as well.

One interesting accessibility fix is the error notification system on the checkout page. Yes, the missing fields error show on top of the page when trying to place an order, but once you scroll down to fill them out again you might need a reminder of which field is missing without having to scroll back up to check the error.

This is quite difficult to explain, so take a look at the screenshot. The suggestion here is to also add “inline” error notifications (“XYZ is a required field“) right above each field, so that the user knows exactly what to do. So, let’s see how it’s done.

Continue reading WooCommerce: Display Required Field Errors “Inline” @ Checkout

WooCommerce: Move / Remove Coupon Form @ Cart & Checkout

Coupons: the good, the bad and the ugly. WooCommerce coupon codes are great to convert more sales – but sometimes they get users to pause / stop placing the order until they find a coupon code online (you did it too, I know).

One good workaround that the internet giants such as Amazon and eBay have implemented is to hide the coupon form until an email is entered, or alternatively to move the coupon code to the bottom of the Checkout page. This is a very smart move, and gets the user to concentrate on the Cart / Checkout details before entering or searching for a coupon.

So the question is – how to remove the coupon form in the Cart page and how to move the same to the bottom of the Checkout page? Well, as usual, a bit of PHP can help us. Here’s how it’s done!

Continue reading WooCommerce: Move / Remove Coupon Form @ Cart & Checkout

WooCommerce: Cart and Checkout on the Same Page

This is your ultimate guide – complete with shortcodes, snippets and workarounds – to completely skip the Cart page and have both cart table and checkout form on the same (Checkout) page.

But first… why’d you want to do this? Well, if you sell high ticket products (i.e. on average, you sell no more than one product per order), if you want to save an additional step (two steps convert better than three: “Add to Cart” > “Cart Page” > “Checkout Page” – and this is not rocket science), if your custom workflow and ecommerce objectives require you to manage Cart and Checkout all together, well, this tutorial is for you.

There is a mix of shortcodes, settings and PHP snippets you can use to make this work out of the box. And trust me, this is easier than you think.

While many developers decide to turn the checkout process into a “Multi-Step Checkout” (ehm, not sure why – the more steps the more likely it is to have a cart abandonment), in here we’ll see the exact opposite.

So, how do they do it?

Here’s the complete, easy, step by step guide to put Cart & Checkout on the same page. Give it a go, do some WooCommerce testing and tracking, and see if it converts better πŸ™‚

Continue reading WooCommerce: Cart and Checkout on the Same Page

WooCommerce: Add Checkout Fees Based on Custom Radio Button

This is a great WooCommerce snippet (or plugin, if you wish to call it like that) for those who want to provide conditional checkout fees. For example, you might need to display custom checkout radio buttons to pick premium packaging types, gift wrapping options, specific services or whatever can increase your AOV (Average Order Value).

Radio button selection must work with “Ajax” – which means as soon as the radio button is chosen, checkout must refresh in order to display the updated fees and totals.

Something similar (and also more complex, such as offering additional products) is achieved by the WooCommerce Checkout Add-Ons Plugin sold on the official WooCommerce.com marketplace. But in this case, we want to take a look at custom coding so you’ve got something to play with! Enjoy.

Continue reading WooCommerce: Add Checkout Fees Based on Custom Radio Button

WooCommerce: Hide Checkout Fields if Virtual Product @ Cart

If you sell downloadable/virtual products and need to simplify your WooCommerce checkout when such product type is in the Cart, you’ve come to the right place!

Here’s a simple snippet, as well as a handy mini-plugin, that checks if there are only “virtual” products in the Cart and hides all the billing fields and order notes (except name and email).

The mini-plugin also allows you to enable this for free virtual orders only, and to move the relevant billing fields under a toggle instead of removing them all together.

Enjoy!

Continue reading WooCommerce: Hide Checkout Fields if Virtual Product @ Cart

WooCommerce: Rename “Place Order” Button @ Checkout

The “Place Order” button is the call to action you want ALL customers to take, right? Well, changing its label to a more specific, custom message could mean a small increase in sales conversion.

Thankfully, you can try this with as low as 4 lines of PHP, even if you don’t know coding. Just copy and paste the snippet by following the instructions below and give your unique store a unique checkout message πŸ™‚

Continue reading WooCommerce: Rename “Place Order” Button @ Checkout

WooCommerce: Save “Terms & Conditions” Acceptance @ Checkout

When going legal… you need proof. Accepting the “Terms and Conditions” on the checkout is required in order to place an order – but how can you, WooCommerce store admin, “prove” that the Terms and Conditions were actually ticked by the customer?

One of the solutions might be to save such acceptance in the database and print the acceptance on the order admin (and maybe on the customer invoice as well). So, here’s a quick PHP snippet you can simply copy and paste in your child theme’s functions.php file in order to (1) save and (2) print the choice on the Single Order Admin page. Enjoy!

Continue reading WooCommerce: Save “Terms & Conditions” Acceptance @ Checkout

WooCommerce: Change Autofocus Field @ Checkout

If you decide to delete or reorder checkout fields, you probably also need to change the checkout field with “autofocus”. In plain English, this is the checkout field where the keyboard cursor goes automatically to on checkout page load (by default, this is the Billing First Name).

As usual, changing this default behavior is very easy, even if you’re not familiar with PHP. In the example below, I’m removing the autofocus from Billing First Name and assigning it to the Billing Email field instead.

Copy the snippet, test it on your development environment and only then push it to your live website. Enjoy! Continue reading WooCommerce: Change Autofocus Field @ Checkout

WooCommerce: Add Content Under “Place Order” Button @ Checkout

Adding content to the WooCommerce Checkout page is very easy.

All you need is to identify the position where you want to show your content (by using my WooCommerce Checkout Visual Hook Guide) and then create a short PHP function that prints on screen the content you need.

In this example, we will see how to add some content below the “Place Order” button on the WooCommerce Checkout page. This could be very helpful, for example, to print your GDPR-compliant Privacy Policy message and make sure the user is aware about the use of personal data. Continue reading WooCommerce: Add Content Under “Place Order” Button @ Checkout

WooCommerce: Display Order Delivery Date @ Checkout

Here’s how you can add a “calendar” field on the WooCommerce checkout page, let people decide the delivery date, and save this value in the order.

It took me ages to implement this for a client (it was much more complex, with available dates, different calendars based on different shipping zones, max weight per day, etc) so I thought of sharing the basic snippet with you! Enjoy πŸ™‚

Continue reading WooCommerce: Display Order Delivery Date @ Checkout

WooCommerce: Turn Checkout Field Into a Drop-down

Talking about UX optimization, the WooCommerce checkout is where you should focus most of your time. Shopping cart abandonment is a huge issue – think about hidden charges, lack of payment methods, checkout bugs and, also, too many checkout fields to fill out manually.

Today, we will see how to turn a checkout text field into a select dropdown. Why not let customers pick from a list instead of typing in? Enjoy!

Continue reading WooCommerce: Turn Checkout Field Into a Drop-down

WooCommerce: Send Checkout User Info to Email Recipient

When my blog readers become official Business Bloomer supporters, a few custom fields are conditionally displayed on the WooCommerce checkout (thanks to this snippet or this other snippet).

For example I show a custom user Twitter field. Thanks to the snippets, this is automatically saved into the WordPress User Profile page. But as I love to thank each Business Bloomer supporter on Twitter, I wanted to generate an additional email reminder (to myself, or to an assistant’s email address for example) with the Twitter username I should be thanking. You might need something like this if you need to send a new customer email address to a coworker. Or maybe a new address to a dropshipper…

So, how do you send a custom email with some user information, after such user completes the checkout and a new WooCommerce order is created? Continue reading WooCommerce: Send Checkout User Info to Email Recipient

WooCommerce: Display Product Categories @ Cart & Checkout Pages

While working for a freelance client I had to “detect” the cart item categories in order to apply some PHP customization.

So I thought – why not share with you how to display product categories in the Cart and Checkout? This adds a nice touch to those two vital pages, and prints a list of product categories under each cart item.

Also, I’m glad to introduce you to the amazing world of “wc_get_product_category_list“, a very handy WooCommerce PHP function!

Continue reading WooCommerce: Display Product Categories @ Cart & Checkout Pages

WooCommerce: Per-Product Terms & Conditions @ Checkout

A freelance client sells two distinct products on the same website: a membership and an online course. Two different audiences, different formats and… different Terms & Conditions.

The goal was therefore to display the “Terms & Conditions” checkbox on the Checkout page based on the product in the cart. Once again, we’re going to use Conditional Logic. With that, the snippet is pretty easy to code!

Continue reading WooCommerce: Per-Product Terms & Conditions @ Checkout

WooCommerce: Add “Confirm Email Address” Field @ Checkout

A correct email address is worth a thousand dollars, some ecommerce expert would say πŸ™‚ So, you don’t want your WooCommerce checkout visitors to mess up with that, do you?

What about adding an “Email Verification” field? In this way, we can make sure they double check their entry – and also show an error message in case they don’t match!

Let’s see how I implemented this for a freelancing client of mine – I’m sure you will be grateful!

Continue reading WooCommerce: Add “Confirm Email Address” Field @ Checkout

WooCommerce Checkout Fields Customization Guide

Checkout page plays a huge role in your eCommerce success. It is one of the most important part of your conversion funnel. This is the page that brings revenue.

It doesn’t matter how many people are visiting your website if no one makes any purchase. Complicated checkout process is one of the main reason of high shopping cart abandonment.

You should always look for ways to make your checkout process as simple as possible. If you are using WooCommerce as your eCommerce solution you can easily change the checkout page design, remove or change the existing checkout fields order.

Continue reading WooCommerce Checkout Fields Customization Guide

WooCommerce: Tax Exempt User Based on Checkout Field Value

There is a nice WooCommerce function you can use to exempt someone from Tax/VAT calculations. You could, for example, enable exemption once they enter a Tax/VAT number, or maybe if they specify a given ZIP code.

Such function is called set_is_vat_exempt(), and together with a little trick to “get” a checkout field on the go, the snippet is pretty simple to build and test. Enjoy!

Continue reading WooCommerce: Tax Exempt User Based on Checkout Field Value