View Single Post
  #2  
Old 11-04-2015, 05:24 AM
  razortw's Avatar 
razortw razortw is offline
 

X-Cart team
  
Join Date: Feb 2015
Posts: 807
 

Default Re: How to redirect to product page directly?

Quote:
Originally Posted by sinobest
If a category only has 1 product, how to let the category page redirect to the product page directly?

tks.
Hi.
Try to insert this to the /light_responsive/customer/home.tpl right after the opening <body> tag.
Code:
{if $main eq 'catalog' and $cat_products|@count eq 1} <script type="text/javascript"> window.location.href = "{$cat_products[0].page_url}"; </script> {/if}
__________________
Best regards,
Igor Pudovkin
X-Cart hosting team
Reply With Quote