Update WooCommerce product prices to match Comparison Set prices

The following code will update your WooCommerce products' prices with the lowest price and highest price found in a product's  Comparison Set


This code will only update a WooCommerce product's price when the Comparison Set is created or updated. Therefore, if you add this code to your site, you may need to wait a period of time (see WordPress Admin Area > Datafeedr API > Comparison Sets > Cache Lifetime) before your product prices start to get updated.


Create a custom plugin

If you haven't done so already, create a custom plugin.


Add code

Add the following code to your custom plugin:



Save your changes.

Now after your Comparison Sets begin updating (or when they are created), your WooCommerce product prices will be updated.

Still need help? Contact Us Contact Us