Posted by on November 5, 2015

At www.loupesusa.com ,  several categories only have one product. The default category will only display one product, that make the category looks very ugly, I think if a category only has one product, we can hide the category, when a visitor click 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}
Posted in: X-Cart

Comments

Be the first to comment.

Leave a Reply