Print Page | Close Window

Link to product SKU

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Using ProductCart
Forum Description: Running your store with ProductCart
URL: https://forum.productcart.com/forum_posts.asp?TID=5014
Printed Date: 07-March-2025 at 2:47am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Link to product SKU
Posted By: amscompanies
Subject: Link to product SKU
Date Posted: 26-February-2012 at 8:35pm
How can I link to a product based on it's SKU ?
 
For example
 
http://www.programmehut.com/store/pc/viewPrd.asp?SKU=3453452" rel="nofollow - http://www.programmehut.com/store/pc/viewPrd.asp?SKU=3453452



Replies:
Posted By: Greg Dinger
Date Posted: 26-February-2012 at 8:47pm
viewPrd.asp relies upon idProduct, which is the record ID associated with the product record in the products table.
 
To do what you want would require an additional function.  Add code to viewPrdCode.asp that queries the product record based on SKU. (Make sure you adhere to no duplicate SKU numbers.)
 
Then at the top of the logic in viewPrd.asp, you have to test for SKU being present in the querystring.  If non-blank, call your new function to return the idProduct associated with that SKU, and the rest of viewPrd.asp can then run in otherwise unaltered form.


-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: amscompanies
Date Posted: 26-February-2012 at 8:53pm
The alterantive would be when I import it uses the SKU as productID, which do you think would be better ?
 
I certainly won't have any duplicate SKU's


Posted By: Greg Dinger
Date Posted: 26-February-2012 at 9:00pm
idProduct is an auto-increment integer field.  As such, starting at 1, you would have to alter the database to support your proposed idea.  The consequences of this are significant as it pertains to all of the product admin stuff.  Why do that when the above solution can be done by a competent programmer in less than an hour.

-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: amscompanies
Date Posted: 26-February-2012 at 9:02pm
Wanted an opinion on which would be easier and I think you have just given me the answer :) How much would you charge to do that ?


Posted By: Greg Dinger
Date Posted: 26-February-2012 at 9:06pm

Let's take this off-forum.  Please e-mail me at my site. 



-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |



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