Get and compare WooCommerce current version

$current_wc_version = get_option( 'woocommerce_version', null );
$wc_version_to_compare = '2.6.0';
if ( version_compare( $current_wc_version, $wc_version_to_compare, '>=' ) ) {
    // current WooCommerce version is equal or above 2.6.0
    // do stuff...
} else {
    // current WooCommerce version is below 2.6.0
    // do stuff...
}

No comments yet.

Leave a Reply