love the helpful resources here. This seems so simple but I'm getting stumped on it.
The concept is simple, I think - each of my items for sale have configurable flavors. One item may have 5 flavors, the next may have 2. I'm not looking to display all of those flavors, but simply include "5 Flavors" or "2 Flavors" under each product on the list page.
Here's my code so far...
<?php if($_product->isConfigurable()): ?> <?php // get attributes ?> <?php $attributes = $_product->getTypeInstance(true)->getConfigurableAttributes($_product) ?> <?php if(count($attributes)): ?> <span class="flavor_count"><?php echo count($attributes); ?> Flavors</span> <?php endif;?> <?php endif;?>