I'm having an issue with stash holding onto some content when looping through records.
I have a BrilliantRetail catalog listing page which loops through all the entries in a category. Within this tag, I'm using the related_products tag to pull out the related products and then store them in two different places within that loop so that I don't have to call and execute the related_products tag twice.
However, on products which don't have related entries it appears to be just repeating the stored content.
{exp:stash:set parse_tags="yes" parse_conditionals="yes" name="br_bulk"}
{exp:brilliant_retail:product_related product_id="{product_id}"}
{related_products}
{if "{related_type_id}"=="2"}
<a href="{exp:brilliant_retail:path src='product/{related_url}'}" title="click here to view {related_title}">{exp:snippet total="40"}{related_title}{/exp:snippet}</a><br />
</li>
{/if}
{/related_products}
{/exp:brilliant_retail:product_related}
{/exp:stash:set}
and then further down the page, I have two pieces of code which are:
{if "{exp:stash:not_empty name='br_bulk'}"}
<div class="bulk">
<strong>Bulk Order Options Available</strong>
<br /><br />
{exp:stash:br_bulk}
</div>
{/if}
followed by a final
{exp:stash:destroy name='br_bulk'}
Just before I close the {exp:brilliant_retail:catalog} tag.
However, it looks like this 'destroy' function isn't working as expected (or I've misunderstood its function).