Created
March 11, 2018 21:02
-
-
Save gareth-gillman/1028cb1391f36fbb70116a63cae116df to your computer and use it in GitHub Desktop.
Count and Echo number of variations for a product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $woocommerce, $product; | |
$variation_count = count( $product->get_available_variations() ); | |
echo $variation_count; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment