updated to works fine with woocommerce 2.0 or later