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: “Is This a Gift?” Checkbox @ Single Product Page

A client of mine asked me to code a checkbox on the single product page called “Is this a gift?”. They noticed that their customers who want to gift the product to a friend get confused with the “Shipping to a different address” form in the WooCommerce checkout.

So, what about renaming “Shipping to a different address” into “Who is this gift for?” if a “gift” is in the cart? Well, this snippet does just that and you can adapt it / customize it to your specific case. Continue reading WooCommerce: “Is This a Gift?” Checkbox @ Single Product Page

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: How To Become an Advanced Developer?

Well, get ready for a 2,700+ words article: becoming a WooCommerce expert won’t take you just a couple of days.

A few months won’t be enough either.

If you want to join that very small group of advanced freelancers and agencies that exclusively work with WooCommerce clients and charge top dollar, if you want to become a WooCommerce authority and build a successful career, if you want clients to come to you as opposed to you chasing them, well – you need to digest and assimilate what I’m about to tell you.

In this (long) article I will help you understand what is advanced WooCommerce, and then break this down into 5 simple steps.

Five makes-a-lot-of-sense steps you should follow in order to complete your journey.

So, want to become a WooCommerce ninja? A WooCommerce wrangler? A WooCommerce guru?

Well, despite I dislike all those ninja-like “terms”, let me tell you a thing or two. Then, join me in the comments and let’s keep the conversation going.

Continue reading WooCommerce: How To Become an Advanced Developer?

WooCommerce: How to Test Geolocation?

Great question, isn’t it?

How do you make sure your shipping, taxes and currency settings are working properly when they depend on geolocation and you can only test from a single world location?

WooCommerce uses a free geolocation service called MaxMind. By default this is active via the settings but can be disabled. The set of functions (or class) that WooCommerce uses is in the /includes folder, and it’s called Class WC_Geolocation.

Continue reading WooCommerce: How to Test Geolocation?

WooCommerce: Check if Product Category is in the Cart

We already studied how to detect if a product ID is in the cart – but if you take a look at the comments many of you were asking how to detect product categories.

So, today we’ll do exactly that. You can disable shipping rates, payment gateways, you can print messages, you can apply coupon programmatically… there are lots of things you can do “conditionally”, based on whether a given product category is in the Cart or not.

Continue reading WooCommerce: Check if Product Category is in the Cart

WooCommerce: Detecting Current User Country (Geolocation)

You may need to add some “personalization” to your WooCommerce website homepage. For example, you could print a custom greeting based on the user’s IP address.

For that, you can use PHP and WooCommerce inbuilt MaxMind Geolocation integration (when enabled from the General Settings Tab, of course).

Detecting the current user country could be very useful for other tasks, such as disabling payment gateways and shipping methods, printing country-specific content and so on. Enjoy!

Continue reading WooCommerce: Detecting Current User Country (Geolocation)

WooCommerce: Get Product Data (ID, SKU, $) From $product Object

I’ve been wanting to publish this guide for a long while. As a WooCommerce development freelancer, every day I repeat many operations that make me waste time… and one of them is indeed “How to get ____ if I have the $product variable/object?“.

For example, “How can I get the product SKU“? Or “How can I get the product short description“? Or maybe the product stock level, shipping class, tax class, price, regular price, sale price, and so on… hopefully this article will save you time.

Of course, not always you have access to the $product global – but you may know the $product_id. In this case, you can use the wc_get_product WooCommerce function to calculate the $product object – you find this case scenario below.

Other examples might be the order or the cart page. Once again, in here you don’t really have a $product available, so you have to loop through the order/cart items and “get” it. After that, you can then calculate and get any piece of information you require out of $product. Enjoy!

Continue reading WooCommerce: Get Product Data (ID, SKU, $) From $product Object

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: Display & Save WP User Field (e.g. user_url) @ Checkout

I’m curious to know how many had the same problem. At WooCommerce checkout, some user fields such as billing_name, shipping_address_1, etc. are automatically saved into the “WordPress User Profile” upon processing.

But what if we also wanted to display and save another existing user field, such as “user_twitter”, or “user_url”, which you can find in the WP User Profile by default? Well, this is very easy: first, we add a custom checkout field; then, we make sure that when the checkout is processed we save that field correctly! Continue reading WooCommerce: Display & Save WP User Field (e.g. user_url) @ Checkout

WooCommerce: Ship to Predefined “Local Pickup” Addresses

WooCommerce Shipping Zones are quite easy to override / customize. With a simple PHP (and jQuery, sometimes) snippet we can accomplish many advanced shipping rules, such as the one we’ll study today.

This time, I’ve tested a snippet to add a dropdown to the billing section where users go choose the pickup destination. As a result, the shipping address is automatically populated, and so is the shipping method. What do you think?

Continue reading WooCommerce: Ship to Predefined “Local Pickup” Addresses

WooCommerce: What is it? Is it Free?

WooCommerce is a free software that allows WordPress users to sell products or services directly from their own website.

It is one of the best WordPress ecommerce solutions for building and growing an online business.

It became hugely popular due to its flexibility and simplicity, as well as the variety of free and premium add-ons and a massive developer community. It is a dominating force in the global ecommerce world and accounts for over 20% of the total market share as of 2023.

In this post, we’ll take a look at the WooCommerce history, as well as its pros and cons as an ecommerce software.

Continue reading WooCommerce: What is it? Is it Free?

WooCommerce: Enable Payment Gateway Only for “Order Pay Checkout”

I invoice clients via WooCommerce, and then send them the “Invoice Email”, which takes them to the “Order Pay” page. Of course, I want to give them the option to pay via “Bank Transfer” (bacs), but I don’t want this to be visible on the default checkout page.

We’ve seen in the past how to disable payment gateways given certain conditions… but how do we “enable” one? Here’s a snippet for that – enjoy!

Continue reading WooCommerce: Enable Payment Gateway Only for “Order Pay Checkout”

WooCommerce: 85 Free Plugins for Every Challenge

free woocommerce plugins

WooCommerce is one of the most popular WordPress plugin for adding eCommerce or cart functionality to a WordPress website. According to recent research by aheadWorks, WooCommerce now accounts for 26.5% of the total eCommerce market share. And recent acquisition by Automattic indicates that it has a great future ahead.

WooCommerce is well known for its huge flexibility and vast customization options. There are hundreds of WooCommerce plugins or Extensions available for extending the functionality. If you want some recommendations in this direction, check out some of the best free WooCommerce plugins (sorted by number of active install).

Continue reading WooCommerce: 85 Free Plugins for Every Challenge

WooCommerce: Add House Number Field @ Checkout

A North European client told me they’re really strict about billing and shipping addresses over there. Couriers usually require a separate “House Number” in order to dispatch packages within those countries.

This must be therefore placed on the checkout, BESIDE the “Address_1” field and made required. Also, it’s a good idea to make this show in the Admin Order, thank you page and notification Emails.

Continue reading WooCommerce: Add House Number Field @ Checkout