What do you need help with?

Start typing your WooCommerce question.


Code Snippet: Display WooCommerce highest variable product price only

Here is a code snippet that displays the highest price only for WooCommerce variable products instead of the default price range.

add_filter( 'woocommerce_variable_sale_price_html', 'con_show_max_variation_price_only', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'con_show_max_variation_price_only', 10, 2 );
function con_show_max_variation_price_only( $price, $product ) {
// Main Variation Price
$prices = array( $product->get_variation_price( 'max', true ), $product->get_variation_price( 'min', true ) );

$price = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
// Sale Variation Price
$prices = array( $product->get_variation_regular_price( 'max', true ), $product->get_variation_regular_price( 'min', true ) );
sort( $prices );

$saleprice = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );

if ( $price !== $saleprice ) {
    $price = '<span style="display:none;">' . $saleprice . '</span> <ins>' . $price . '</ins>';
    return $price;


Based on this handy snippet by Gerhard. Not sure how to use this? Here is how to use custom code snippets like this.

Mini plugin: Disable WooCommerce prices and add to cart for visitors

This is a mini plugin that lets you hide WooCommerce prices
and the add to cart button for non logged in visitors of your site.

Install and activate to hide the elements site-wide.


Shop overview:


Screen Shot

Single Product page:

Screen Shot



Download Disable WooCommerce prices and add to cart for visitors plugin


Tested with:
WordPress 4.6.1
WooCommerce 2.6.6

How to fix revoultion slider MySQL Fatal error: Uncaught exception ‘Exception’ with message ‘fetch

Today I was playing around with Revolution Slider and had trouble getting it to run in my Multisite test environment.

Upon activation this error would pop up:

“Fatal error: Uncaught exception ‘Exception’ with message ‘fetch – <b>Unknown column ‘type’ in ‘where clause'</b><br>—<br> Query: select * from wp_revslider_sliders where type !=

To solve this edit revslider.php located in revslider root directory:


$rsv = get_option('rs_version', 0);
if(version_compare($revSliderVersion, $rsv, '>')){
update_option('rs_version', $revSliderVersion);

Right before:

add_action('plugins_loaded', array( 'RevSliderFront', 'createDBTables' )); //add update checks
add_action('plugins_loaded', array( 'RevSliderPluginUpdate', 'do_update_checks' )); //add update checks

Also add:

update_option('revslider_table_version', '1.0.0');

right before php closing tag.

Here is how it should look:

Screen Shot

Deactivate and reactivate Revolution Slider.
This should fix the error.


How to setup one time / on-off payment or free plan in WooCommerce Subscriptions

Setting up a one time payment

WooCommerce Subscriptions offers a signup fee you can use to collect a one time payment using WooCommerce Subscriptions.
Here is how.

  • Set the recurring price to zero
  • Set the duration to the required time
  • Set the sign up fee to the full amount you want to collect

Screen Shot

click on the image to enlarge.

Setting up a free plan to downgrade to

If you want your users to be able to downgrade to a free plan you can use WooCommerce Subscriptions and setup a variable Subscription product.

  • Setup a plan type attribute

Screen Shot

click on the image to enlarge.

  • Set zero for recurring price and sign up fee

Screen Shot

click on the image to enlarge.

Using payments prorating you can also offer your customers to switch to annual payments at any time.

That is it. You can spin up a free test site at any time at http://wcdemo.com to test these settings and comment here with any question you have.



How to fix saving issues in WooCommerce and WordPress

Sometimes you have trouble saving settings in WooCommerce. Your shipping zones do not get saved or your WooCommerce Bookings resources fail to get saved. Here are possible issue scenarios for you
to check.


 Corrupted WooCommerce database tables

Not being able to save may indicate damage to your WooCommerce MySQL database tables. The best way to fix this is to completely deinstall WooCommerce manually followed by a new installation. This rebuilds the database tables anew

Plugin conflict interfering

The form failing to save may be due to conflict between active components. You can check this by deactivating all plugins but the one you need. Alternatively Plugin Organizer is a more elegant way to do this check. You can use a plugin filter to deactivate plugins on a specific admin page only. I made a video tutorial on how to use it here.

Further read: How to check and resolve conflict in WordPress and WooCommerce

Too much form data sent.

If you notice product variations, tax rates and other large data sets not saving, Suhosin (a security module in PHP) may be preventing the POST data from being saved. This issue can also be caused by servers with version PHP 5.3.9+ and servers running mod_security. To verify that you are really experiencing the issue describe in this document, you can temporarily install and activate this free plugin: https://wordpress.org/plugins/wp-max-submit-protect/

For troubleshooting information read this article on WooCommerce.com.

How to find the right CSS class to edit to apply custom CSS in WordPress

There are many plugins for WordPress that allow you to apply custom CSS. Most theme have their dedicated sections. However how do you know which class you need to modify?

Use Google Chrome development tools to inspect

I use Google Chrome development tools for this. Here is a quick screencast that shows how to find the right class and edit / apply custom CSS:

Here is what I do step by step

  1. The tab titles “Description” and “Reviews” are crammed into the left corner. I want them to move more to the right.
  2. 00:02: I toggle Chrome development tools (dev tools) by right-click, inspect. I right-click on the element I want to change. Clicking on the element I want to edit opens the markup and jumps to the vicinity or right on the element I want to edit.
  3. 00:09: After the dev tools open I realise the layout is now responsive. I need it to be in standard desktop layout. I switch the dev tools from dock right to dock to bottom. This gives the layout more room in width and gets rid of the responsive layout.
  4. 00:17: I click on the elements in the markup until my element is fully selected. At first #tab-reviews looks good, but ultimately reviews_tab is more complete in highlighting my element. You often have to correct the element selection after toggling the dev tools via right-click – inspect.
  5. 00:22: The WooCommerce tabs class has a margin defined. Seems right. I deactivate what is already there to see if anything changes. I then add some on my own and watch for changes. It gets crossed out immediately which means it is getting overwritten. No good, moving on.
  6. 00:34: I move up one class and spot the padding. Editing to see if that changes anything and heureka. The rest is simple try and error.

That is it. I hope it helps you to find your own CSS classes to successfully apply your custom CSS.

Feel free to comment with any questions you have.

Mini Plugin: Show WooCommerce Orders Shortcode

This is a mini plugin that lets you show WooCommerce orders
via shortcode.

Install, activate and use via [show_wc_orders] to show all orders, [show_wc_orders order_counts=10] to show 10 orders.
Replace 10 with x to show x orders.



Screen Shot


Screen Shot




Download Show WooCommerce Orders Shortcode plugin


Tested with:
WordPress 4.6.1
WooCommerce 2.6.4