Year: 2022

Common Things Unite Us

Family gathering at festive table

This week I’ve been reflecting on the things that unite us as a community, as people, as family, and as friends. I think it comes down to common interests and the common good.

WooCommerce Function of the Week: wc_get_held_stock_quantity

A getting stock from a shelf in a warehouse.

Welcome back to WooCommerce Function of the Week! This week we cover a little hidden gem within the WooCommerce plugin code: wc_get_held_stock_quantity(). As the name suggests, this function helps you get the amount of stock present in pending orders for a given product.

If your store relies on careful stock management β€” maybe because you handle products with a small inventory β€” wc_get_held_stock_quantity is very useful. As orders come in for a limited number of products, you can take special action. Maybe you need to cancel those orders, or maybe you want to entice the customers placing them to complete their purchases before the item goes out of stock.

So, as usual, let’s first take a look at the function syntax and then consider a practical example of how you might use or display the returned value. Enjoy!

Read more

A2 Hosting
Omnisend
WordPress.com