Print Page | Close Window

One product in a category

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=4159
Printed Date: 14-July-2025 at 5:31pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: One product in a category
Posted By: bp_travis
Subject: One product in a category
Date Posted: 19-November-2010 at 3:01pm
When a category only has one product in it, is there a way to direct PC to go right to the product detail page without first showing the product in a listing and then the detail page?

Thanks



Replies:
Posted By: Brett
Date Posted: 19-November-2010 at 7:46pm
On viewcategories.asp between lines 985 and 986 (may be different lines on your file, not sure if mine is modified), add these lines of code:

if pcv_intProductCount=1 then
     response.Redirect(pcStrPrdLink)
end if

This should be between count=count + 1 and loop, which is the main product loop of the viewcategories.asp page, right before this line:

<%' If page style is M, show the Add to Cart button when


Try that out and let me know if it works please. At the end of the first iteration of the main product loop, it checks the product count and if it is only one then it immediately redirects to that product page.

*edit*
Tested on my site and appears to work fine. Here's a copy of the original 4.1sp1 viewcategories.asp with the modification already made:
uploads/1159/viewcategories-oneproduct.zip - viewcategories-oneproduct.zip


Posted By: bp_travis
Date Posted: 22-November-2010 at 4:51pm
Tried it out and it works great! Thanks


Posted By: Brett
Date Posted: 22-November-2010 at 4:54pm
No problem. Glad to hear it worked for you.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net