WooCommerce Not Working After Moving It To New Server

July 3rd, 2013 - Posted by Steve Marks to PHP, Web Development.

I’ve just moved an e-commerce WordPress site that uses the WooCommerce plugin to another server and, when going to view the new site, I started receiving the following error:

PHP Fatal error: Call to a member function is_visible() on a non-object in /public_html/wp-content/plugins/woocommerce/templates/content-product.php on line 23

I checked the template file at the point where the error was occuring and this is what I found:

// Ensure visibilty
if ( ! $product->is_visible() )

After commenting out these lines it simply then failed at the next $product related function. Next I tried checking whether $product was set:


// Output: NULL

Weird. It worked fine on the development server, so why would it suddenly break after moving it? Luckily the solution is an easy one (if not a little odd) …

The Solution

The above problem can be resolved by simply navigating to ‘Plugins’ within WordPress, deactivate the WooCommerce plugin and then re-activate it. What it’s doing exactly I’m not sure, however after performing these steps the errors stopped and site returned to how it should be.

This entry was posted on Wednesday, July 3rd, 2013 at 8:43 am by +Steve Marks and is filed under PHP, Web Development. You can follow any responses to this entry through the RSS 2.0 feed.

Fear not, we won't publish this

Comments (0)

No comments have been left yet. Be the first