Hide Certain WooCommerce Sub-Categories in Catalog

WooCommerce provides some coarse control over displaying sub categories in your shop/category pages with the “Show subcategories on category pages” and “Show subcategories on the shop page” options on the WooCommerce > Settings > Catalog > Catalog Options section. These controls are all-or-nothing though: show all subcategories on the category pages, or show all subcategories on the shop page. If you want finer-grained control, for instance displaying only certain subcategories on the shop or particular…

Read More

WooCommerce reviews + tutorials

How to Set WooCommerce Virtual Order Status to Complete After Payment

Please note that this snippet will work for WooCommerce 2.0 and 2.1, but not 2.2+ – the order status structure has changed in version 2.2 to support refunds. If we post an updated version, we’ll link to it here when published. WooCommerce virtual orders can be automatically marked as ‘completed’ after payment with a little bit of code added to a custom plugin, or your themes functions.php file. By default WooCommerce will mark virtual-downloadable orders…

Read More

WooCommerce reviews + tutorials

Create an Overrideable WooCommerce Template File

Sometimes when developing a WooCommerce plugin you want to output a snippet of HTML, and do so in such a way that the content can be easily overridden by a theme. It’s part of the process of crafting a well-engineered, customizable plugin. The best way to achieve this is by using WooCommerce’s own templating mechanism, and what once took some effort and some filters is now a snap thanks to one of the recent WooCommerce…

Read More

WooCommerce reviews + tutorials

How to Determine the WooCommerce Current Page

WooCommerce makes it a snap to programmatically determine the current page through the use of their Conditional Tags. These functions can be used to check whether the current page is the shop page: is_shop(), or a product page: is_product(). See WooCommerce Conditional for the full list. These functions are based on the standard WordPress Conditional Tags, and thus behave in the same manner. Meaning that if you try to determine your current page from within…

Read More

WooCommerce reviews + tutorials

Add ‘Sold Out’ to WooCommerce Variable Product Dropdown

Note: Due to a change in WooCommerce 2.0 the following code no longer works, and I’m not seeing any way of making it compatible again – Justin This is a quick little ‘how to’ that came up in a recent client WooCommerce request. The client wanted to add the text ‘sold out’ to the variable product configuration dropdowns on the product page to make it more clear to customers when a variation was out of…

Read More

WooCommerce reviews + tutorials

Creating a Custom Plugin For Your WooCommerce Shop

I plan to put together a mini series covering the basics of properly planning, engineering, launching and maintaining a WooCommerce shop. In the future as I write additional articles I will link them together, for now this first article will cover the basics of creating a custom plugin for your WooCommerce site, and provide you with a plugin skeleton to download and use as a starting point. This article assumes a familiarity with basic WordPress…

Read More