Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janisdonis/d1e9b625295852d0f6cde97397dea71c to your computer and use it in GitHub Desktop.
Save janisdonis/d1e9b625295852d0f6cde97397dea71c to your computer and use it in GitHub Desktop.
Attribute loop
$terms = get_the_terms( $product->id, 'pa_vizualais-stavoklis');
foreach($terms as $term){
if($term->slug == 'jauns' || $term->slug == 'jauns-bez-kastes' || $term->slug == 'a-plus') {
$used = '<used>0</used>';
echo $used;
}
else {
$used = '<used>1</used>';
echo $used;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment