WooCommerce – Page 5

Add Fields into WooCommerce New Product Editor

Since I have a plugin that allows you to share products between different WooCommerce stores, I’ve been keeping an eye on the New Product Editor for quite a long time.

I know that people have different opinions about it, but this post is not about whether you like this new product editing experience or not, it is all about adding your custom product fields into it.

As a result of this tutorial, we will have a custom checkbox field in the “Organization” tab:

How to add custom fields into the new WooComerce product editor
As an example, I decided to show you the fields I will need to add to my Simple WP Crossposting plugin when the new WooCommerce product editor goes out of beta.

Let’s dive into this whole process step by step.

Back in Stock Notifications for a WooCommerce Store

In this step-by-step tutorial I am going to show you how to add a “notify me when back in stock” kind of form to your WooCommerce product pages which will allow you to collect emails from customers and when a product is actually back in stock to automatically send notifications to everyone who was previously subscribed.

This feature is also called a waitlist. Below is an example how it works:

Example of a WooCommerce back in stock notifications form

Allow Duplicate SKU

By default it is not allowed to use duplicate SKU in WooCommerce, you might get an error like this if you try to save a product with a SKU which already exists:

Invalid or duplicate SKU error – how to allow duplicate SKU in WooCommerce

But there are cases where duplicate SKU is necessary! So what are the options?

How to Make Variation Shared Inventory on your Store

In this tutorial, we will discuss WooCommerce stock management for variations. Specifically, I want to share with you different approaches to setting up a shared stock for WooCommerce product variations.

The common ways of implementing a variation shared stock are:

  1. Using the shared stock for all variations of a specific product.
  2. Assigning the same SKU for specific variations (doesn’t matter whether they belong to the same product or different products) and reducing stock for all variations with the same SKU synchronously. This approach can be implemented with the plugin.
  3. Combining specific variations into a group, and if any variation from the group has been purchased, we will reduce the stock levels of the whole group.
  4. Assigning a stock quantity to a specific attribute and then managing the inventory on the attribute level.

For most of the ways mentioned above, I will show you the programmatic approach (with a code snippet), except for the one that will require the use of a WordPress plugin.

Now, let’s dive straight into it.

Create a Custom Stock Status

In this tutorial I am going to show you how you can create a custom stock status for your WooCommerce products. There are a bunch of plugins over there, which allow you to implement similar functionality in one way or another, but why to use a plugin when can do exactly the same with a couple of lines of code in your theme. But of course, it depends.

As an example here we will create a “Contact us” custom product stock status, which will be kind of similar to “Out of stock” – customers won’t be able to add a product to a cart, but there is going to be a link to a contact page instead of an “Add to cart” button.

This custom product stock status will work with both standard WooCommerce features (like product filters) and third party plugins (my Duplicate SKU stock sync plugin for example).

Check if a Product Has Variations

In this simple tutorial I’d like to show you easy ways to check whether a specific product has variations or not.

The first thing you need to understand here is that variations are also a custom post type product_variation and “variation posts” are always child in relation to “product posts”.

The second thing is that we have public (“Enabled” checkbox is checked) and private (“Enabled” checkbox is unchecked) variations:

Enabled (public) and private variations of WooCommerce products

The thing is that depending on whether your variation is public or private, you need to use different functions and class methods.

WooCommerce Network Orders Dashboard Widget

Today I am going to talk about a very interesting widget in WooCommerce which is available to you only when you’re using WooCommerce within a WordPress Multisite network:

WooCommerce network orders dashboard widget

This widget appears in two places:

  • Network admin dashboard,
  • Admin dashboard of a main site of your multisite network (usually a site with ID = 1).

In order for this widget to appear, WooCommerce has to be either network activated or activated for the main site of your network.

Let’s take a look how this widget really works.