I have created a view that is grouped by taxonomy term and it displays exactly how I want it. But what I need to do is add the term ID that the view is grouped by as a class, I have the following custom views template created but the term ID is not available as a variable to use.
The template is views-view-unformatted--products.tpl.php
where I have printed the title as the class of the wrapper I need to add the term ID instead (the title is actually the term name as this is what the view is grouped by.)
<div class=<?php print '$title)'; ?>>
<?php if (!empty($title)): ?>
<h3 class="quick-view-closed"><?php print $title; ?></h3>
<?php endif; ?>
<div class="product-list" hidden>
<?php foreach ($rows as $id => $row): ?>
<div<?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"'; } ?>>
<?php print $row; ?>
</div>
<?php endforeach; ?>
</div>
</div>