Added support for both WC 1.X and 2.X formats
Updated to work on both 1.6 and 2.x WooCommerce versions.