Last active
June 15, 2017 20:21
-
-
Save mahdi-alavi/bb7133e68209d731e6c1 to your computer and use it in GitHub Desktop.
Woocommerce Display Product Attribute Variations
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 $product; | |
$attributes = $product->get_attributes(); | |
foreach ( $attributes as $attribute ) { | |
$terms = wp_get_post_terms( $product->id, $attribute['name'], 'all' ); | |
foreach ( $terms as $term ) { | |
echo $term->name .'<br>'; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment