I have a loop of products that generate a list with link but, if the product is only one, must be redirect to a product page, instead of display the list.
The code is:
<ol>
{exp:channel:entries channel="prod" category="{segment_3_category_id}"}
{if total_results==1}
{exp:hs_redirect location="/prod/view/{segment_3}/{url_title}"}
{/if}
<li>
<a href="/prod/view/{segment_3}/{url_title}">{descr_prod}</a>
</li>
{/exp:channel:entries}
</ol>But doesn’t work. It’s always redirect, seems that redirect is processed before {if}{/if} statement.
I have tried also with EE {redirect} tag, without success.
What’s wrong?