Page 1 of 1

Navigate between Prouct Pages Able 7.x

Posted: Fri Aug 13, 2010 2:50 pm
by rhuffman
In Able 5.x when a use is on a product page a Navigation function displays as follows:

<< Prev Product 4 of 57 Next >>

Is this function available in 7.x ?
This allows the user to navigate between products without going back to the category page.

If not, does anyone know how to genertate code to create same functionality of each product page?
Any help would be greatly appreciated.

Ray Huffman
Darby Creek Trading Co.
www.DarbyCreekTrading.com

Re: Navigate between Prouct Pages Able 7.x

Posted: Sun Aug 15, 2010 10:39 pm
by mazhar
You can try to create custom user control for this purpose under ConLib/Custom folder. In user control you need to load the current product's category and then pick what products are to be shown on next, previous options. I think that perhaps you will require to write some custom query to load next, prev products.

Re: Navigate between Prouct Pages Able 7.x

Posted: Sun Aug 15, 2010 10:46 pm
by s_ismail
We have done something similar for a client. See the previous and next navigation options on top right side of product details dialog.
http://www.musthavebag.com/Chicklit-wal ... ch-P7.aspx

Re: Navigate between Prouct Pages Able 7.x

Posted: Mon Sep 06, 2010 7:12 pm
by rhuffman
After a month of attempting to work with a couple of good Able developers, Able is not able (no pun intended) to do a simple navigation as it had in Able 5.x. I have tried the product from Plugables and another developer and while they will certainly go forward (NEXT) and backwords (PREV) they always jump to another cateogry if a product has muliple categories and the end user ends up browsing for products not related to the cateogry they were in.

Please visit the following: http://www.darbycreektrading.com/Fall-S ... -C481.aspx
When you click on the very first item you will see it starts at Product 3 of 37
and if you go to the next it will relect product 5 of 118 and take you to a differenct cateogry than what the user was in.

Able 7.x has been out for three years and seems to be missing some very basic functionality that existed in 5.x.
If anyone can share their experience on this it would be greatly appreciated.

This is function that I think most users would want.

Re: Navigate between Prouct Pages Able 7.x

Posted: Thu Sep 09, 2010 12:04 pm
by jmestep
We have this working now- action is like Able 5 and it doesn't bounce around to different categories.
http://www.darbycreektrading.com/Donnas ... 5C288.aspx

Re: Navigate between Prouct Pages Able 7.x

Posted: Wed Sep 15, 2010 10:07 am
by plugables
rhuffman wrote:... I have tried the product from Plugables and another developer ...
Well that certainly was not a product. It was just a piece of code made available for free.

Attaching it here for the well-being of others as well.
ProductNavigator.zip
Put the files in ConLib/Plugables folder and use it like this
[[ConLib:Plugables/ProductNavigator]]

About Products in multiple categories
When a product is in more than one categories there is no way to figure out which category or criteria to consider for deciding the next and previous product of the current product. Next and Previous mean next and previous products in a category.
So when a product is in more then 1 categories, when we say 'next' product what do we mean? next in which category?

Re: Navigate between Prouct Pages Able 7.x

Posted: Mon Sep 27, 2010 9:39 am
by payntingCode
I made a custom conlib user control...

simple page that references the same "using" list as the BuyProductDialog.

Code: Select all

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CommerceBuilder.Catalog;
using CommerceBuilder.Common;
using CommerceBuilder.Products;
(truly not all of those are needed...)

on the .ascx i added the following code:

Code: Select all

<%@ Register Assembly="CommerceBuilder.Web" Namespace="CommerceBuilder.Web.UI.WebControls" TagPrefix="cb" %>
<asp:Literal ID="PreviousNext" runat="server"></asp:Literal>
then in the code behind file i added the following to the Page_Load function

Code: Select all

        string prevLink = "<a href='' ><< Prev</a>";
        string currentPlace = "<b style=\"font-size:14px;\">Product #</b>";
        string nextLink = "<a href='' >Next >></a>";

        List<Product> myList = ProductDataSource.NarrowSearch("", PageHelper.GetCategoryId(true), thisProduct.ManufacturerId, 0, 0, 0, 0, "Name DESC");
        int currentProdIndex = myList.IndexOf(thisProduct);
        if (currentProdIndex == 0)
            prevLink = "";
        else
            prevLink = prevLink.Replace("''", "'" + myList[currentProdIndex - 1].NavigateUrl.Replace("~/", "") + "'");
        if (currentProdIndex == (myList.Count - 1))
            nextLink = "";
        else
            nextLink = nextLink.Replace("''", "'" + myList[currentProdIndex + 1].NavigateUrl.Replace("~/", "") + "'");

        currentPlace = currentPlace.Replace("#", (currentProdIndex + 1).ToString() + " of " + myList.Count.ToString());

        PreviousNext.Text = prevLink + "&nbsp;&nbsp;&nbsp;" + currentPlace + "&nbsp;&nbsp;&nbsp;" + nextLink + "<br />";
i then added this conlib reference to the Show Product1.htm file in the scriptlets/custom/content folder.

Code: Select all

[[ConLib:custom/ProductPreviousNext]]
Two issues i am looking to solve now:
1) i need the SEARCH CRITERIA - the "sort by" and the "keywords" from the category listing page. So in cases where the "sort by" is not "Name DESC", the ordering is not as it was on the category list page.
2) for some reason the categoryId will reference the lowest level of the category for the product - so it seems. for example: if category A has two subcategories A1 and A2 and on the Category A list of products i click a product that is in the A1 subcategory - the "prev-next" list of products becomes only those products in the subcategory A1.

hope this makes sense to you all and might be helpful.