Page 1 of 1

Product navigation Next/Prev for products in same category

Posted: Sat Dec 20, 2008 12:38 pm
by jmestep
I'm working on some code someone else had written to put Next/Prev links on top of a product page for navigation to other products in that category. He has used a for each(CommerceBuilder.Catalog.CatalogNode ) in the code and that puts the Cxx Category number in the URL and I am trying to remove that. How do I turn that node.NavigateUrl into a product NavigateUrl?

Re: Product navigation Next/Prev for products in same category

Posted: Mon Dec 22, 2008 4:39 am
by mazhar
Try following

Code: Select all

node.ChildObject.NavigateUrl
Or

Code: Select all

switch (node.CatalogNodeType)
        { 
            case CatalogNodeType.Product:
                Product product = ProductDataSource.Load(node.CatalogNodeId);
                Response.Redirect(product.NavigateUrl);
                break;
        }