Skip to content

Instantly share code, notes, and snippets.

@gareth-gillman
Created March 11, 2018 21:02
Show Gist options
  • Save gareth-gillman/1028cb1391f36fbb70116a63cae116df to your computer and use it in GitHub Desktop.
Save gareth-gillman/1028cb1391f36fbb70116a63cae116df to your computer and use it in GitHub Desktop.
Count and Echo number of variations for a product
<?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