How to let X-cart redirect to product page directly?

At www.loupesusa.com, several categories only have one product. The default category will only display one product, which makes the category looks very ugly, I think if a category only has one product, we can hide the category when a visitor clicks the category, the category URL will redirect the detailed product page directly. How to then?

Try to insert this to the /light_responsive/customer/home.tpl right after the opening <body> tag.

{if $main eq 'catalog' and $cat_products|@count eq 1}
  <script type="text/javascript">
    window.location.href = "{$cat_products[0].page_url}";
  </script>
{/if}