Hello
I'm trying to figure out how to jump to a product page when an SKU is passed in. Something like this...
http://www.myshop.com/Default.aspx?SKU=ASDF-ASDF
Any pointers on how to go directly to the product with the matching SKU?
Thanks!
Jump to product page
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 21
- Joined: Tue Mar 03, 2009 10:49 am
Re: Jump to product page
Create some custom control that reads sku from query string and then loads products with matching sku on run time. For example you could use some custom query
Also read following article it may help you.
viewtopic.php?f=45&t=6971
Code: Select all
string sku = Request.QueryString["Sku"];
ProductCollection products = ProductDataSource.LoadForCriteria(" Sku LIKE '"+sku+"'");
...
...
viewtopic.php?f=45&t=6971
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 21
- Joined: Tue Mar 03, 2009 10:49 am
Re: Jump to product page
Getting closer.
So that will help me get the product that matches that SKU. But how do I jump to that product page?
If I have a product called something like "Super Mobile Phone", the URL for the product page looks something like ".../Super-Mobile-Phone-P60.aspx". Is there a way to know what the URL for a product?
Thanks!
So that will help me get the product that matches that SKU. But how do I jump to that product page?
If I have a product called something like "Super Mobile Phone", the URL for the product page looks something like ".../Super-Mobile-Phone-P60.aspx". Is there a way to know what the URL for a product?
Thanks!
Re: Jump to product page
You can use Product.NavigateUrl property to get the product details page url for a product.