Category link in Wishlist page

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
crockettdunn
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 105
Joined: Sun Oct 26, 2008 6:32 pm
Contact:

Category link in Wishlist page

Post by crockettdunn » Mon Jan 23, 2012 7:26 pm

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.

User avatar
crockettdunn
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 105
Joined: Sun Oct 26, 2008 6:32 pm
Contact:

Re: Category link in Wishlist page

Post by crockettdunn » Mon Jan 23, 2012 7:41 pm

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.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Category link in Wishlist page

Post by jmestep » Tue Jan 24, 2012 8:40 am

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

Post Reply