How to redirect to product page directly?
If a category only has 1 product, how to let the category page redirect to the product page directly?
tks. |
Re: How to redirect to product page directly?
Quote:
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} |
Re: How to redirect to product page directly?
i think it is not good use js to redirect the category page to product page.
at www.loupesusa.com, category of Feather LED Headlight, the url is http://www.loupesusa.com/feather-led-headlight/, when i clip the category, www.loupesusa.com/feather-led-headlight/ will be display first, then jump to product page of http://www.loupesusa.com/feather-super-light-led-headlight.html. very bad for seo how about like this: if a category has only 1 product, just let the product page url as category page url. i think it is better for seo. category of Feather LED Headlight only has 1 product, then let http://www.loupesusa.com/feather-led-headlight/ be this category's url directly. not need using http://www.loupesusa.com/feather-led-headlight as its url. how to meet this demands, pls? |
Re: How to redirect to product page directly?
Quote:
how to use php code to meet the same function? not use js. |
Re: How to redirect to product page directly?
Quote:
You can try to use the header('Location: function * http://php.net/manual/en/function.header.php |
Re: How to redirect to product page directly?
{if $main eq 'catalog' and $cat_products|@count eq 1}
{php} header("{$cat_products[0].page_url}"); {/php} {/if} not working |
Re: How to redirect to product page directly?
Quote:
2. You should use the header() PHP function in PHP scripts, not in template files. 3. I believe you should hire someone to do custom modifications for you. |
All times are GMT -8. The time now is 08:21 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.