WooCommerce: How to Sync Products, Stock and Orders Between Several Stores

Running multiple WooCommerce stores can be a recipe for success, but keeping your products and stock levels synchronized across them can quickly turn into a nightmare.

Imagine the frustration of a customer trying to buy a product that shows “in stock” in one store, only to find it out of stock when they checkout. Yikes.

But fear not! This tutorial is your guide to conquering inventory chaos with product and stock syncing. We’ll dive into the amazing benefits of syncing your WooCommerce stores (e.g. products, stock, orders, etc.) so you can streamline your operations and watch your sales grow.

This multi-store functionality typically requires the use of additional plugins or services designed to manage multiple WooCommerce sites – one such solution is the WooMultistore plugin.

Continue reading WooCommerce: How to Sync Products, Stock and Orders Between Several Stores

WooCommerce: Hide Sale! Badge If Product Is Out Of Stock

If a product cannot be purchased because it is out of stock, why would you want to tell people that it’s on sale – only because it has a sale price?

That would probably clutter your shop and maybe get the customer to click on the wrong item just because it was standing out, only to find out they can’t purchase it!

So, let’s fix this little “design bug” in WooCommerce – let’s make sure the Sale! badge gets hidden in case the product is out of stock. Enjoy!

Continue reading WooCommerce: Hide Sale! Badge If Product Is Out Of Stock

WooCommerce: Variable Product “Cumulative” Stock Quantity

When a variable product stock quantity is managed at variation level, the stock status is either “In stock” or “Out of stock” without any mention of the quantity.

It would be cool, however, and in certain cases only, to show the total stock quantity for all single variations. If variation Red has 3 in stock, variation Blue has 7 in stock and variation Cyan has 10 in stock, I’d like to set the “parent product” stock quantity to 3 + 7 + 10 = 20.

So, how do we do that?

Continue reading WooCommerce: Variable Product “Cumulative” Stock Quantity

WooCommerce: 6 Inventory Management Issues

In the competitive world of eCommerce, managing your inventory effectively is a key factor in achieving success.

However, for many WooCommerce store owners, grappling with common inventory management issues can be challenging.

As you no doubt know, inventory management can often be a complex task, but it doesn’t have to feel overwhelming.

By understanding all of these common issues found in WooCommerce inventory management and implementing the suggested solutions, you can improve efficiency, decrease errors, maintain customer satisfaction and ultimately drive your eCommerce business towards success.

To bring you up to speed, let’s talk through some of these problems and offer practical solutions to help streamline operations.

Continue reading WooCommerce: 6 Inventory Management Issues

WooCommerce: Display Stock Status For External Products

By default, WooCommerce external products do not have and do not display any stock, as they are simple redirects to an external URL. This may be unfortunate, because before clicking on an external URL and send people away from your website, you may want to make sure the current item is in stock (so that you have more chances to convert the sale and earn a referral commission, if that’s your business model).

So, how do we “manage stock” for an external product, and display the stock status on the single product page, just before the “Buy Product” button?

Continue reading WooCommerce: Display Stock Status For External Products

WooCommerce: Additional Stock Inventory Location

The WooCommerce plugin allows you to manage stock for each product, but you only have a single stock quantity field!

What if you have two warehouses and, as a store admin, need to manage the inventory for each location? Besides, what if an item is out of stock at location 1, but it’s in stock at location 2, and therefore the customer needs to be able to purchase it?

This amazing workaround will add a second input number in the product settings, redefine stock quantity and status on the frontend by summing up stock 1 + stock 2, and finally decrease stock 1 until it goes to 0, after which it will decrease stock 2.

This default behavior can be changed of course e.g. it’s possible to define from where the stock is reduced (by distance?) via additional code. Also, additional code can be written to make it compatible with variable products or custom product types, as well as make it work with refunds. Either way, enjoy!

Continue reading WooCommerce: Additional Stock Inventory Location

WooCommerce: Stock Quantity in a Shortcode

It’s great that WooCommerce products clearly display their stock status and quantity on the single product page (and on the shop page, with this simple customization).

However, WooCommerce store owners often need to display the stock quantity in other sections of the website, such as the homepage, a blog post, a custom pricing table, and keep the quantity dynamic so that the text changes when there is a stock change.

We can therefore build a simple shortcode, that can automatically update the output, so that you never need to worry about changing that piece of content ever again. Enjoy!

Continue reading WooCommerce: Stock Quantity in a Shortcode

WooCommerce: Disable Restocking @ Order Cancelled

When an order that has previously reduced stock is “cancelled” or goes to “pending payment” because the payment failed or the store admin decided to change the order status, the wc_maybe_increase_stock_levels() function triggers and restores the order items’ stock quantity.

As usual, some WooCommerce entrepreneurs asked for a way to disable this automatic restocking given their custom setup. It often goes like that – you can’t really please everyone.

This is unless you’re a smart developer and can account for both options, thanks to a WordPress “filter“. Here’s a PHP one-liner that can immediately disable this default behavior, so that you can avoid the automatic restocking (and maybe doing it manually based on your business rules). Enjoy!

Continue reading WooCommerce: Disable Restocking @ Order Cancelled

WooCommerce: In Stock Products Shortcode

We’ve already coded a solution to display WooCommerce out of stock products only via a custom shortcode – today we’ll do the opposite: how can we display in stock products only via a handy shortcode?

Once again, the solution “gets” the list of products IDs that are in stock, and then passes the result to the official [products] WooCommerce shortcode, so that we don’t reinvent the wheel.

You can then use the [in_stock_products] shortcode anywhere you wish – on a blog post, in a custom page, in a widget, and so on. You can even customize the output with the official WooCommerce [products] shortcode parameters such as columns, orderby, limit, etc. Enjoy!

Continue reading WooCommerce: In Stock Products Shortcode

WooCommerce: View Stock History @ Product Admin

When questions such as “How do you save the product stock inventory history?” pop up in our private Business Bloomer Club slack channel for WooCommerce developers, I can’t really do without thinking of coding it myself!

This neat customization saves the stock quantity of a simple product or a variable product variation before there is a stock change, due to a manual stock quantity edit or a customer order.

Please bear in mind that if you have hundreds of stock movements per product this may slow down your backend and/or database, so the snippet may need some sort of optimization or limitation (“last 10 movements”).

So, let’s see how it works. Enjoy!

Continue reading WooCommerce: View Stock History @ Product Admin

WooCommerce: Hide Price If Product Out of Stock @ Frontend

Sometimes, the nature of ecommerce businesses requires some extra features. Thankfully, WooCommerce allows to customize pretty much everything based on whatever condition.

Today, we’ll see how to hide prices for out of stock items, on the shop, categories, archives, loops and single product page.

Think of an art gallery which sells unique art pieces, and doesn’t want to let users know for what price sold an item. Or maybe an online business that often runs discounts – why reveal at which price sold an item that is now out of stock? Of course, there are way more case scenarios – I’d be curious if you shared yours in the comment area.

But for now, copy and paste the snippet and that’s it, you’re good to go. Enjoy!

Continue reading WooCommerce: Hide Price If Product Out of Stock @ Frontend

WooCommerce: Remaining Stock @ Order Emails

This is a neat customization, directly requested by a WooWeekly subscriber who needed to literally show the remaining stock quantity for each ordered item to store managers, in order to have an immediate idea of low/zero stock quantities after each order.

If that’s not clear, simply take a look at the screenshot. In my dev site, I ordered a product that originally had stock quantity = 1. In the “New Order” email (thanks to the snippet below), beside the order item quantity of 1, there is also a “(0 remaining)” notice that clearly displays the item’s current stock level.

Cool, ha? So, let’s see how that’s coded. Enjoy!

Continue reading WooCommerce: Remaining Stock @ Order Emails

WooCommerce: Stock Quantity Suffix e.g. “sq. in.”, “Kg”, “boxes”, etc.

Each WooCommerce business is different, which means customization is required to adapt the store to unique specifications.

A clear example is the stock quantity. Not all stores can display the standard notice “11 in stock”. The display could change to “11 Kg in stock” if stock is based on weight. Or maybe “11 boxes in stock” or “11 pairs in stock” in case the package description is useful UX-wise. Also, “11 m3 in stock” if the business sells volumes.

Either way, this is a nice trick to display a “stock quantity suffix” in your WooCommerce Single Product Page. Enjoy!

Continue reading WooCommerce: Stock Quantity Suffix e.g. “sq. in.”, “Kg”, “boxes”, etc.

WooCommerce: Rename “Read more” To “Out of stock” @ Shop

There is an unfortunate (IMO) add to cart button naming on the WooCommerce shop page / category pages / product loops. When an item is out of stock, the “Add to cart” (or “Select options” for a variable product type) button label will turn into “Read more”.

To be honest, that doesn’t really say much to the end customer. It’s quite confusing and doesn’t make much sense.

Today, we’ll see how to change that “Read more” label into something more comprehensible: “Out of stock”. A super easy trick. Enjoy!

Continue reading WooCommerce: Rename “Read more” To “Out of stock” @ Shop

WooCommerce: Waiting List for Out-Of-Stock Products

There’s no better feeling than “selling out” and still having more customers who want to buy your products. But while this image looks exciting, it comes with a considerable downside. 

Sold-out products put you at risk of losing customers – simply because they wouldn’t know when a product is back in stock to purchase it. They can also frustrate your customers and make them buy from your competitors instead, leading to business and customer loss.

But what if there was a way to avoid this?

By enabling waitlists for your online store, you can keep customers updated about their favorite product’s availability and immediately notify them when it’s back in stock

This will not only help you keep customers engaged but also prevent you from losing valuable sales. You don’t have to take our word for it – research suggests notifying customers when products come back in stock turns 10-15% of requests into actual purchases. 

Creating and managing waiting lists online can be pretty taxing with all the back-and-forth. Good thing you have WooCommerce waitlist plugins to make the job easy for you. These plugins help you manage your stock, add customers to waitlists, and automatically send alerts about their desired products. 

This article will take you through six of the best WooCommerce waitlist plugins that can help you recover missed sales. But first, let’s understand how these plugins work and can help your bottom line. 

Continue reading WooCommerce: Waiting List for Out-Of-Stock Products

WooCommerce: “Hide Out of Stock Items” Exception

WooCommerce stores with large inventory often decide to hide out of stock products from the website. As you all know, there is a WooCommerce setting for that, right under Settings > Products > Inventory called “Out of stock visibility“. With the tick of a checkbox you can toggle the visibility of products that ran out of stock and immediately return a clean shop page with no unpurchasable items.

The story is, it could be you may want to still show out of stock items on a specific page via a custom shortcode, or limit the out of stock visibility setting only to certain categories.

Well, today we will learn a cool WordPress hook called “pre_option_option“, that basically allows us to override whatever settings we have in the WordPress admin, and assign our own value on a specific page or condition. Enjoy!

Continue reading WooCommerce: “Hide Out of Stock Items” Exception

WooCommerce: Conditionally Force Product Quantity 1 @ Cart

There are times when the WooCommerce product settings alone are not enough. You can already tick the “Sold individually” checkbox in the “Inventory” product data tab in the single product edit page to force quantity 1 for whatever product: “Enable this to only allow one of this item to be bought in a single order“.

Problem is, you may need to set this “programmatically” (via code), based on certain conditions. One reason is that you may not want to edit hundreds of products one by one (or in bulk) – another is that you may want to “override” whatever settings based on certain conditions (for example, you set “Sold Individually”, but if the Cart total is greater than 100 you want to allow quantities greater than 1).

As you can see, in this post we will cover, once again, the magic of “conditional logic“. Enjoy!

Continue reading WooCommerce: Conditionally Force Product Quantity 1 @ Cart

WooCommerce: Show Product Stock @ Cart Page

We’ve already seen how to display stock quantity and status on the Shop Page – today we’ll do something similar, but this time we’ll work on the Cart product table, so that we can visually display stock status and quantity to WooCommerce customers who are about to checkout.

Please note – in order for the snippet to work you must have “stock management” enabled, and also each single product in the cart must have “managing stock” checked and, if on backorder, “allow but notify customer” must be selected, otherwise you will see nothing. Enjoy!

Continue reading WooCommerce: Show Product Stock @ Cart Page

WooCommerce: Disable Out of Stock Variations @ Variable Product Dropdown

A nice way to avoid user frustration is to never let them pick a product / variation that is out of stock, only to realize later they can’t purchase it.

A variable product comes with a “select dropdown” on the single product page, from which customers can pick their favorite variation. Problem is that ONLY after selecting this they will find out about price, stock status and may be able to add to cart.

Today, we’ll completely disable (grey-out) those select dropdown options (variations) that are out of stock, so that users don’t waste time and only pick one of those that are in stock. Enjoy!

Continue reading WooCommerce: Disable Out of Stock Variations @ Variable Product Dropdown

WooCommerce: Display “In Stock” Products First @ Shop

We’ve already seen how to add a custom “Product Sorting” option to the “Default Sorting” dropdown in the WooCommerce Shop page.

The task I was presented with, however, was to display items based on a custom “meta key”. Now, if you have no idea what a “meta key” is, don’t worry too much. For example, “_stock_status” is one of these keys, and therefore you can sort products by that key as opposed to product name, date, price, etc.

So, let’s see how to show all out of stock products as last in the shop, category and loop pages. As usual, simply copy/paste this little plugin in your functions.php and you’ll get the wanted result 🙂

Continue reading WooCommerce: Display “In Stock” Products First @ Shop