I’m building a site which will be selling yarn. Each type of yarn is a grouped product, which is made up of simple products in each colour and shade. I wanted to show a colour swatch next to each associated product and so using a very helpful post I found on the forum, I modified the template/catalog/product/view/type/grouped page with this line
<td><?php echo '<a href="'.$this->helper('catalog/image')->init($_item, 'image').'" ><img src="'.$this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50, 50).'" width="50"><a>'; ?></td>
It works great.
However the site will also be selling knitting needles. Again these will be grouped products with each size as an associated product. But I don’t need to have a swatch next to the item. They all look the same so the main photo is fine on its own.
I would like to put a conditional statement above my modified to code so that it only shows the swatch that if the product is in “yarn” category.
I can’t work how to say “if the category is yarn then...”. Can anyone help me please?