Returns an array of WooCommerce products and product variations.

Use this as a building block for your own WooCommerce plugins or hacks. The function will return an array of all WooCommerce products and product variants. It removes parent products from the array and returns the list in alphabetical order.

The array includes the post_id, the product’s title and SKU.. Useful for producing tables of your products for bulk stock or price editing or just viewing or exporting.

The Code


The function returns an array in the format: title, SKU, product_id.