WooCommerce - Total Product Count including Variations

Is there a way to show the total amount of products in WooCommerce including variations?

For example;
T-Shirt - Plain
T-Shirt - MultiColour (Variations; Red, Blue, Green, White, Black)
Jumper - Plain
Jumper - MultiColour (Variations; Red, Blue, Green, White, Black)

WooCommerce shows this as 4 products, I want to it to show me the 12 products including variations.

If there is a piece of code or a plugin to do this would be great!

Thanks

  • Rupok

    Hi Charlie,

    Thanks for asking. I just searched for the solution of this issue over the Internet but I could not find any ready-made code for doing this.

    However, I've found this StackOverflow answer which describes how you can get available variations for any specific product and then loop through this for all your products to get the total number with custom coding. I know this is not an optimum process if you have many products, but I'm afraid, this is the only way I found.

    If you are not comfortable with such advanced custom coding, you can always hire a developer from our Jobs Section for doing this type of custom tasks. Please keep in mind, developers found in our Jobs Section are not associated with us in any way. So communicate with them well before you make any payments to them.

    Please let us know if you have any further query. We will be glad to help.

    Have a nice day. Cheers!
    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.