product by category
-
Hi everyone.
I am using categories and attributes form my products.I obtain a list of my attributes like this.
echo '<ul>'; $terms = get_terms( 'pa_country' ); foreach($terms as $item_term ): ?> <li class="data_tag"> <?php $term_link = get_term_link( $item_term ) ?> <a href="<?php echo $term_link; ?>" class="name_category"> <?php echo $item_term->name; ?> </a> <img src="<?php echo get_template_directory_uri(); ?>/img/<?php echo $item_term->name; ?>.jpg" class="img-responsive"/> </li> <?php endforeach; echo '</ul>';when I click in the links this show me all the product with the same attribute, but How to do , if I want the product by category and attribute…
For example, I have three products all with attribute “dark” but two of this are from category “day” and the other one is category “night”
Now when I click in the link this show me three, but I want to show the categories like Day (2product) and Night (1 product) How to do that?
Any idea, thanks in advances!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘product by category’ is closed to new replies.