Print Page | Close Window

getting the parent category Id

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=1099
Printed Date: 15-July-2025 at 11:36am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: getting the parent category Id
Posted By: gjk2701
Subject: getting the parent category Id
Date Posted: 18-September-2007 at 10:58am

Hi,
I am working on customizing product cart to work with my site - just starting out.
My left navigation is dependent on the current category and/or parent category  - I am able to access the category id using the variable intIdCategory but can't see how to get at the parent category.
thanks in advance for any help.
gjk



Replies:
Posted By: Jackalope
Date Posted: 18-September-2007 at 12:30pm

I believe that when you click the link to the "child" category and the page is displayed, right below the category heading is the navigation (somthing like "Our Products:...". You should be able to click the category just before the "child" category that is currently being displayed and get the link for the "parent" category.

If anyone knows of a better way, let us know.



Posted By: netprofits
Date Posted: 18-September-2007 at 12:56pm

If you are creating a custom list of categories and not using the default list built into product cart, you can read the record in the categories table for the category ID you are currently working with (intIdCategory) and get the idParentCategory field from that record. Something like this:

"Select idParentCategory From categories Where idCategory =" & intIdCategory



-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: gjk2701
Date Posted: 18-September-2007 at 1:41pm
Thanks, I will do that. I was wondering if I could avoid a database hit - i.e if it might already be done and assigned to a variable I could access similar to the intIdCategory. It would be nice to have a list of the variables that are available based on the standard code...
appreciate the help.



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