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…

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…

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…

WooCommerce Order Admin Calc Line Totals

Compatibility Notice: The following article and code applies to pre-WooCommerce 2.1 only. It is not compatible with WooCommerce 2.1+ As of version 1.6.5.2 at least, WooCommerce does not provide a way to automatically calculate the Line Subtotal and Line Total values for a given product quantity, when creating or updating an order through the Order Admin: As shown in the above image, there’s a button to calculate the line taxes for the order items, as…

WooCommerce reviews + tutorials

Override WooCommerce Template File Within a Plugin

The goal of this article is to describe one approach to overriding WooCommerce core template files within a custom plugin, such that they can still be overridden by a theme in the typical way. Note that this is similar to but solves a slightly different problem than what we did to create a custom overrideable woocommerce template file in your custom plugin. Overriding a core template in your plugin is something you might want to…

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…

How to Use WooCommerce’s Lightbox

[stag_alert style=”grey”]Update: As of version 2.0, WooCommerce is no longer packaged with the excellent FancyBox (I guess due to some licensing issue or something). I’m leaving this article up for those still on WC 1.6.6 and previous, and for historical purposes. To learn how to make use of the new WooCommerce-2.0 compatible lightbox, read on in the new and updated article How to Use WooCommerce Lightbox Part 2[/stag_alert] WooCommerce comes with Fancybox, a Lightbox implementation,…

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…

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’ ); /**…

WP Development

Extending the WordPress XML-RPC API

The purpose of this article is to describe the WordPress XML-RPC API, explain how to use it, and demonstrate how to extend it to create custom API methods for interacting programmatically with WordPress. I assume a relative unfamiliarity with XML-RPC in general, WordPress XML-RPC, and spend time first covering the basics, if you want to skip straight to the section on extending the WordPress XML-RPC API, feel free to. What is XML-RPC? As defined by…