Fix empty price for variable products on catalogue pages in WooCommerce

For some reason it can happen that prices for a subset of variable products are not being shown on catalogue pages.

The reason is that the product settings have not been saved properly. The cause of this in still unknown to me, since it happens very rarely and is difficult to replicate. But, I’ve created an automated fix which will solve this in case WooCommerce tries to display a variable product with an empty price.

Place the following code into functions.php and it will automatically resync the product prices for that particular product.

Back to Listing