I'm trying to link to a products parent category in the wishlist page, and I'm striking out. How can I expose the parent category id in this page?
thanks.
Category link in Wishlist page
- crockettdunn
- Lieutenant Commander (LCDR)
- Posts: 105
- Joined: Sun Oct 26, 2008 6:32 pm
- Contact:
- crockettdunn
- Lieutenant Commander (LCDR)
- Posts: 105
- Joined: Sun Oct 26, 2008 6:32 pm
- Contact:
Re: Category link in Wishlist page
Maybe I should backup... the real objective is to make a "keep shopping" link that goes back to a category list view. I'm not clear how GetLastShoppingUrl is populated, so I decided to try to grab the category.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Category link in Wishlist page
The last shopping url is defined in the App_Code/NavigattionHelper.cs
Code: Select all
/// <summary>
/// Gets the last shopping url for the current user.
/// </summary>
/// <returns>The last shopping url for the current user.</returns>
public static string GetLastShoppingUrl()
{
HttpContext context = HttpContext.Current;
if (context == null) return "~/Default.aspx";
Page page = context.Handler as Page;
if (page == null) return "~/Default.aspx";
PageViewCollection pageViews = Token.Instance.User.PageViews;
pageViews.Sort("ActivityDate", GenericComparer.SortDirection.DESC);
string homePage = page.ResolveUrl("~/Default.aspx");
string searchPage = page.ResolveUrl("~/Search.aspx");
string wishlistPage = page.ResolveUrl("~/ViewWishlist.aspx");
foreach (PageView pageView in pageViews)
{
if ((pageView.UriStem == homePage) || (pageView.UriStem == searchPage) || (pageView.UriStem == wishlistPage)) return pageView.UriStem + "?" + pageView.UriQuery;
if (pageView.CatalogNodeId != 0)
{
ICatalogable node = pageView.CatalogNode;
if ((node != null) && ((pageView.CatalogNodeType == CatalogNodeType.Category) || (pageView.CatalogNodeType == CatalogNodeType.Product)))
{
return node.NavigateUrl;
}
}
}
return homePage;
}
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx