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

Sending Multiple REST API Requests using PHP Requests Library

Recently I got a message from one of my customer and he complained about that inventory sync in my Simple Inventory Sync plugin doesn’t work as fast as he wanted it to.

When I took a look at his website configuration, I noticed that he wanted to syncronise the product stock up to 10 websites at the same time.

At that moment my plugin was already using batch API requests in case someone made an order with 50 products (for example) at the same time (so we can send only a one request instead of 50), but we can not send a single batch request to 10 different sites, can we?

Dynamic Blocks Explained

I published post series about creating Gutenberg blocks long time ago but somehow I missed the part about dynamic blocks. But it is quite an important topic you need to know if you want to go further and learn about Interactivity API for example and other cool stuff.

In this tutorial first of all I am going to show you the difference between static and dynamic blocks and then we will create a custom dynamic block step by step.

Get Attachment Alt Text, Caption, Description and Title Programmatically

Every time I work with WordPress attachments I always forget what is what, for example:

  • What is the name of the alt text meta field?
  • How to get an image caption programmatically?

Probably after publishing this tutorial I will never forget that again, but I really hope that it will be helpful for you guys.

So, the long story short, in this tutorial I am going to show you how you can get the following attachment data programmatically:

WordPress attachment information – alt text, caption, title and description

Let’s dive into it right now!

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?

4 Ways to Make Variation Shared Inventory on your Store

Recently I’ve been developing a new plugin Duplicate SKU Stock Sync and I found out that a lot of different solutions and approached are out there on how to make a shared stock for WooCommerce product variations.

Let me describe every one of them in this tutorial.

The possible ways to implement a variation shared stock which are commonly used are:

  • Using the shared stock for all variations of a specific product.
  • Combining specific variations into a group and if any variation from the group has been purchased, reduce the stock levels of the whole group.
  • Assigning a stock quantity to a specific attribute and then managing the inventory on the attribute level.
  • Assigning the same SKU for different variations and reducing the stock for all the products with the same SKU, that’s what my plugin does by the way.

And now let’s dive deep into every of the ways mentioned here and try to decide which one is the best.

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).