| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
One product in category, skip thumbnail page | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
One product in category, skip thumbnail page
Hey all! I have a category that just has one product in it. It seems redundant to click on the category link, then, it lists the one product so I have to click it again. Is there any way to have it skip right to the product details page if the category just has one product?
Thanks! Heather
__________________
Thank you! |
|||||||||
#2
|
|||||||
|
|||||||
How about in subcategories.tpl:
{if $cat eq categorynumberwithoneproduct} <a href="product.php?productid=yourprodnumb"> {else} <a href="home.php?cat={ $subcategories[cat_num].categoryid }"> {/if}
__________________
ex x-cart guru |
|||||||
#3
|
|||||||||
|
|||||||||
Too cool! I'm going to look like a genius and I have you to thank. Heck, everyone here does!
Heather
__________________
Thank you! |
|||||||||
#4
|
|||||||
|
|||||||
Question
I would like to do this too...
Not working for me..I have this at the head of the subcategories.tpl {if $cat=251} <a href="product.php?productid=16134&cat=251&page=1"> {else} <a href="home.php?cat={ $subcategories[cat_num].categoryid }"> {/if} My category # is 251 and product # is 16134. Any thoughts? Thanks rgbdna
__________________
v.3.10.5 Great creative direction is clarity cleverly delivered. |
|||||||
#5
|
|||||||||
|
|||||||||
Edit customer/products.php find:
Code:
Add the following after it: Code:
Tested with 3.5.10 (may work with 4.0.x)
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#6
|
|||||||
|
|||||||
Sweeet!
Sweeet! It works great!
I am going to donate to you via Paypal right now! Thanks! rgbdna
__________________
v.3.10.5 Great creative direction is clarity cleverly delivered. |
|||||||
#7
|
|||||||
|
|||||||
sadly, this nice mod conflicts with the html catalog.
Example: If you created a category called "Exclusive" and only put one item in it, say "Space Cowboy Knife". When the user clicks on the category, "exclusive", this mod takes them to "Space Cowboy Knife" if the user is in *php mode. If the user is browsing the html catalog, clicking on the exclusive category will just lead them to a blank page. Can someone else confirm this or am I a dumbass? |
|||||||
#8
|
|||||||||
|
|||||||||
Maybe you could have the products.php code issue a unique value if productcount = 1.
Then use that unique value in the tpl to trigger a redirect. Just a suggestion. It may help if you category page is generated with SOME code in it. By the way, I can confirm that you are not a dumbass. |
|||||||||
#9
|
|||||||
|
|||||||
thanks for the suggestions adp. But I have no php knowledge at all. ;( What would be the code to redirect if the user is in the HTML catalog?
thanks -Version 3.5.11 |
|||||||
#10
|
|||||||||
|
|||||||||
Dunno. I'm not a PHP guy.
That was just a suggestion of how you could put the switch in the tpl. That way the catalog would generate a category page that redirected to the product page. Hiding all of the code in PHP is not giving the catalog a chance to generate the category page. You gotta bug someone smart to help you implement this. It's outta my field. |
|||||||||
|
|||
X-Cart forums © 2001-2020
|