Featured

What do you need help with?

Start typing your WooCommerce question.

 

How to automatically set all WooCommerce orders to complete

Processing instead of complete because of physical shipment

WooCommerce per default sets all WooCommerce orders to processing after a successful payment. The reason behind this is that it assumes you are selling physical goods that need to be shipped.

Complete WooCommerce orders automatically

For many people this does not fit their use case. You might require all your order to automatically complete all your orders. There are several ways to achieve this.

Happy autocompleting.

How to fix responsive layout issues in WordPress

Responsive layout is an important factor for your website. In order to be able to fix an issue you first must be certain that this is happening to every visitor and not just you. Most people use their own phone for testing which is fine, but if you are collaborating with somebody else to help you fix an issue in your responsive layout you require common testing ground. A browser based testing tool also rules out any local issue on your phone.

Use WordPress customizer or similar browser tool to test

The quickest way to test your responsive layout is provided by the WordPress customizer. Have a look:

GIF

Too small? View full size GIF in new tab

I use Responsinator for extended testing.

Apply CSS for mobile views only

Once you have found the right CSS class to target you need to enter your custom CSS in a way that it targets the correct mobile view.

Mobile views are triggered by CSS breakpoints and require media queries.

You can either enter the correct CSS with a media query manually into a custom CSS field or use a plugin to facilitate this. I like using Responsive CSS Editor.

I hope this information helps you to fix your responsive layout issue.

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] );

//Output
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.

Screenshots

Shop overview:

 

Screen Shot

Single Product page:

Screen Shot

 

Download

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:

Add

$rsv = get_option('rs_version', 0);
if(version_compare($revSliderVersion, $rsv, '>')){
RevSliderFront::createDBTables();
RevSliderPluginUpdate::do_update_checks();
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.

Checklist

 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.