We’ve already seen how to add a custom “Product Sorting” option to the “Default Sorting” dropdown in the 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.
Anyway, let’s abandon the Japanese for now (hey, unless you speak Japanese!) and get into the coding – as usual, simply copy/paste this little plugin in your functions.php and you’ll get the wanted result 🙂 Continue reading WooCommerce: Show In Stock Products First @ Shop
A client of mine wanted to show out of stock products on a separate page – so I coded a simple shortcode for you all!
You can use this shortcode for different goals. For example, you might want to display what products you’ve sold to enhance customer trust / social proof.
So let’s see (1) how to create a shortcode and (2) how to take advantage of the existing [products] WooCommerce shortcode and its “ids” parameter to pass just those product IDs that are out of stock! Continue reading WooCommerce: Display Out of Stock Products (Shortcode)
Thanks to the various requests I get from Business Bloomer fans, this week I’m going to show you a simple PHP snippet to echo the variations’ name and stock quantity on the shop, categories and loop pages. Enjoy! Continue reading WooCommerce: Display Variations’ Stock @ Shop Page
In this tutorial, my goal is to show the “stock quantity or status” under each product in the shop, category and archive pages.
This follows exactly the same settings as the stock display of the single product page. Go to /wp-admin/admin.php?page=wc-settings&tab=products§ion=inventory to manage “Stock display format”. Enjoy! Continue reading WooCommerce: Display Stock Status/Quantity @ Shop Page
Another simple snippet that can easily help user experience and make sure the sold out badge shows on every product in the category & shop page. Not all themes allow this so you can use the snippet below to make it happen! Continue reading WooCommerce: Show “Sold Out” on Archive/Product Page
I’ve seen many snippets that change the “In Stock” text on the single product page, but not the FULL string. In this particular case, not only I needed to change the text, but also edit the order of display: from “2 In stock” to “Quantity: 2”. Continue reading WooCommerce: Edit “# in stock” @ Single Product Page