Ask SkyVerge

Add Custom Options to WooCommerce Settings

This question comes in from blog reader Wilgert (thanks Wilgert!): could you help me find some simple code to add a custom option field to the general settings tab of the woocommerce admin area? Trying to avoid re-inventing the wheel here. Well, this may be more than you bargained for, but here we go! The WooCommerce settings can be found under the menu item WooCommerce > Settings and look like so: Like a lot of…

Read More

How to Override WooCommerce Widgets

While it’s not technically possible to override a WordPress widget (and remember WooCommerce widgets are nothing more than WordPress widgets), WooCommerce is just so extendable and pluggable and flexible, that some widget functionality can be nearly completely overridden just using the standard WooCommerce template files and/or template functions. For the widgets that aren’t as pluggable, or if you need greater control, you have the option to un-register a core WooCommerce widget and subclass it, or…

Read More

WordPress development tutorials

Don’t Share Terms Between WordPress Taxonomies

By default WordPress will reuse terms with the same name and slug between different taxonomies (at least for now). For instance, if you add the term ‘red’ as a tag, and then add the category ‘red’, the same wp_terms record will be shared between them. This is also true for any custom taxonomies you define (remember that despite their seeming differences, WordPress tags and categories are both implemented as taxonomies). Now, in general this is…

Read More

How to Add Dimension Units to WooCommerce

This post was prompted by a recent question on the blog regarding how best to add custom units to the WooCommerce dimensions or weight options. While not a difficult thing to do, adding units is not trivial either if you don’t have much experience with PHP, WordPress or WooCommerce. This would be useful for adding, for instance, the foot as a dimension measurement to WooCommerce, which seems to be the most glaring omission. I’m guessing…

Read More

How to Display WooCommerce Products by Subcategory

I recently released a WooCommerce plugin that allows you to organize your products by subcategory in your shop and catalog pages. This extension grew out of a client’s request to alter the standard WooCommerce catalog page layout to show nested child categories on his catalog pages, along with any products that belong to those categories; this is in contrast to the standard catalog pages which simply display all products assigned to the current and any…

Read More

WooCommerce reviews + tutorials

How to Display MSRP Price on WooCommerce Shop Pages

The WooCommerce MSRP Pricing plugin allows you to set an MSRP price for your products and display it on the product page. But what if you want the MSRP displayed on the category/catalog/shop pages? The following is one solution, which will display the MSRP just before the regular product price in the catalog pages. You may need to do a little CSS style tweaking of the displayed MSRP price, depending on your theme and the…

Read More

Ask SkyVerge

Hide WooCommerce "Free" Price Label

A common WooCommerce question lately has been how to hide the “Free” price label in the product/category/shop pages. Thanks to WooCommerce’s judicious use of filters/actions, this is very easy request, yet if you’re new to WordPress/WooCommerce you might not necessarily know exactly where to look. Well look no further, because here’s an easy way to suppress that “Free” notice for regular/variable products: add_filter( ‘woocommerce_variable_free_price_html’, ‘hide_free_price_notice’ ); add_filter( ‘woocommerce_free_price_html’, ‘hide_free_price_notice’ ); add_filter( ‘woocommerce_variation_free_price_html’, ‘hide_free_price_notice’ ); /**…

Read More

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

SkyVerge WooCommerce Extensions

WordPress Pretty Category Permalinks Broken and Fixed

This is probably another one of those situations that applies only to me, but just in case someone else out there happens to have this same broken permalink issue, I’ll describe what happened to my site, and how I fixed it. The specifics of my setup were: WordPress 3.4.1, WordPress SEO 1.2.5, and the custom permalink structure /%category%/%postname%/. The problem that someone thankfully alerted me to (gotta get back in the habit of checking Google…

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