Navigate between Prouct Pages Able 7.x

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
rhuffman
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 24
Joined: Thu May 19, 2005 6:36 pm
Location: Dublin, OH
Contact:

Navigate between Prouct Pages Able 7.x

Post by rhuffman » Fri Aug 13, 2010 2:50 pm

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

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Navigate between Prouct Pages Able 7.x

Post by mazhar » Sun Aug 15, 2010 10:39 pm

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.

User avatar
s_ismail
Commander (CMDR)
Commander (CMDR)
Posts: 162
Joined: Mon Nov 09, 2009 12:20 am
Contact:

Re: Navigate between Prouct Pages Able 7.x

Post by s_ismail » Sun Aug 15, 2010 10:46 pm

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

User avatar
rhuffman
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 24
Joined: Thu May 19, 2005 6:36 pm
Location: Dublin, OH
Contact:

Re: Navigate between Prouct Pages Able 7.x

Post by rhuffman » Mon Sep 06, 2010 7:12 pm

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.

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

Re: Navigate between Prouct Pages Able 7.x

Post by jmestep » Thu Sep 09, 2010 12:04 pm

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
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

plugables
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Sat Aug 15, 2009 4:04 am
Contact:

Re: Navigate between Prouct Pages Able 7.x

Post by plugables » Wed Sep 15, 2010 10:07 am

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?

payntingCode
Ensign (ENS)
Ensign (ENS)
Posts: 1
Joined: Mon Sep 27, 2010 9:24 am

Re: Navigate between Prouct Pages Able 7.x

Post by payntingCode » Mon Sep 27, 2010 9:39 am

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.

Post Reply