Page 1 of 1
Products Not Showing in order as they appear in admin
Posted: Tue Feb 03, 2009 4:32 pm
by creatinggenius
We have entered products in a category and was wondering why they are not showing in the order as they are in admin.
Re: Products Not Showing in order as they appear in admin
Posted: Wed Feb 04, 2009 3:47 am
by mazhar
Please read following thread
viewtopic.php?f=42&t=8011
Re: Products Not Showing in order as they appear in admin
Posted: Wed Feb 04, 2009 10:51 am
by creatinggenius
As i understand Reading thru these posts that I need version 7.2. and If so how do I get it.
Thanks
Re: Products Not Showing in order as they appear in admin
Posted: Wed Feb 04, 2009 10:55 am
by mazhar
Version 7.2 is the next version of the product which will be released soon. Please read following post
viewtopic.php?f=42&t=9484
Re: Products Not Showing in order as they appear in admin
Posted: Thu Feb 05, 2009 6:09 pm
by milstencil
very soon ... very soon...
We are almost at the end of our final QA cycle.
but I won't give you any date or any date range... I am not allowed to.
all I can say is 'very soon' ... which is very subjective ... but rest assured 'very soon' means 'very soon'.
_________________
Regards,
Sohaib
Image.com
AbleCommerce Help Center
AbleCommerce Developer WIKI
Report this post
So..........Jan. 23,
when is "very soon.... very soon....?
We have this problem now.
Regards,
Rick
Re: Products Not Showing in order as they appear in admin
Posted: Fri Feb 06, 2009 7:57 am
by jmestep
The order can be changed in the current build by editing the category conlib for the one you are using. There are several posts about it because different category pages require different kinds of edits. You could try searching the forum for something like "String.Empty" or Sort order. Here is one of them:
viewtopic.php?f=42&t=8907&hilit=+string+empty
Re: Products Not Showing in order as they appear in admin
Posted: Fri Feb 06, 2009 8:14 am
by milstencil
THANK YOU, Judy.
First let me apologize for the terse post.
I had searched the the posts and what I found was that everything is
about "the customer shopping experience" and not the store owner's experience.
Its like going to Home Depot and finding one 2x4 at one end of the store and a
10 footer at the other end of the store.
For the past 14 years, if its not in front of my customers face, they become "challenged'
and go away.
Thanks again,
Rick
Re: Products Not Showing in order as they appear in admin
Posted: Fri Feb 06, 2009 11:25 am
by jmestep
It's frustrating and that problem with the order has generated regular posts. I'm glad Able 7.2 is fixing it because of the different ways you have to change the code. Then you need to know what terms to search for in the forum to find the posts. It took me a while to find the posts again.
Re: Products Not Showing in order as they appear in admin
Posted: Sun Feb 15, 2009 6:57 am
by milstencil
I'll bring this back to the top.
We installed the 7.2 update and we are having the same problem.
The items are grouped in size order: all 10" 12" 15", etc, but not as we have
them listed in the catagory listing: 3", 4", 5", etc.
Did we miss something when we updated?
Regards,
Rick
Re: Products Not Showing in order as they appear in admin
Posted: Mon Feb 16, 2009 8:07 am
by mazhar
milstencil wrote:I'll bring this back to the top.
We installed the 7.2 update and we are having the same problem.
The items are grouped in size order: all 10" 12" 15", etc, but not as we have
them listed in the catagory listing: 3", 4", 5", etc.
Did we miss something when we updated?
Regards,
Rick
The problem is fixed. In order to access the default order you need to create default order list item. For example if you are using the CategoryGridPage to display the category data then edit the ConLib/CategoryGridPage.ascx file and locate following code
Code: Select all
<asp:ListItem Text="By Name (A -> Z)" Value="Name ASC"></asp:ListItem>
and make it look like
Code: Select all
<asp:ListItem Text="Default Order" Value=""></asp:ListItem>
<asp:ListItem Text="By Name (A -> Z)" Value="Name ASC"></asp:ListItem>
Now refresh the page and sort it by Default order and it will list the same order as of merchant.
Re: Products Not Showing in order as they appear in admin
Posted: Mon Feb 16, 2009 8:46 am
by dappy2
Mine doesn't work either. I Just posted that exact code into CategoryGridPage.ascx and it isn't working on some categories. (I had this earlier - sorry for my cross posting:
viewtopic.php?f=42&t=8907).
I have 11 Top Categories, 4 of those have subcategories, for a total of 25 categories. TopCategory 1, TopCategory 8, TopCategory 9 & TopCategory 10 don't obey the admin sort order. They are the categories with subcategories. SubCategory 1-a & Subcategory 8-a (number matches top category) don't obey the admin order. Those subcategories are both the first displayed subcategory but the other Top Categories (9 & 10) have subcategories that obey the admin side.
I don't even know where to look and I've narrowed it down to these categories. This happens no matter what CategoryGridPage*.ascx I use. Should I try recreating everything? Could it be an issue of going from RC2 to 7.0, 7.0.2?
Dappy
Re: Products Not Showing in order as they appear in admin
Posted: Mon Feb 16, 2009 9:39 am
by jmestep
I don't have a 7.0.2 site with a lot of categories that I can experiment with, but try moving something in the admin, moving it back, click to resort, whatever. Maybe something in the table needs to be triggered?
Re: Products Not Showing in order as they appear in admin
Posted: Mon Feb 16, 2009 10:24 am
by dappy2
jmestep wrote:try moving something in the admin, moving it back, click to resort, whatever. Maybe something in the table needs to be triggered?
I did all that.
I methodically went through the admin & storefront moving products around for every single category and wrote down what was not functioning properly. It is odd that it is only 6 out of 25 categories that aren't working.
Where in the DB is this information stored / pulled from? That way I could have my SQL guy take a look and see what is going on. If I could point him in a direction it would be cool.
Do I need to delete them and re-build all that. I'd really rather not do that.
Thanks!
Dappy
Re: Products Not Showing in order as they appear in admin
Posted: Mon Feb 16, 2009 10:43 am
by mazhar
I am unable to reproduce the problem.
Re: Products Not Showing in order as they appear in admin
Posted: Mon Feb 16, 2009 1:54 pm
by dappy2
It seems to me after more testing that the logic for displaying the products in the admin order doesn't account for products that are assigned to multiple subcategories in the same topcategory (I don't have products across multiple topcategories). We have products that do span multiple subcategories - a case for instance that accommodates products from a few categories.
So if ProductA is above Product B in Category1 but not Category2 one seems to override the other.
Dappy
Re: Products Not Showing in order as they appear in admin
Posted: Tue Feb 17, 2009 6:51 am
by mazhar
Could you please post link to the your website and categories that have problem. Also describe the expected order for some products that are in wrong order.
Re: Products Not Showing in order as they appear in admin
Posted: Tue Feb 17, 2009 7:39 am
by dappy2
Unfortunately my store isn't live yet.
It seems like the products get a sort order that is independent of the category (or subcategory at least). I'm not sure if that was intentional or not but on the admin side, the sort order is retained for a product across categories. So in Cat1 I have Product A, B, C, D in that order. And product D, E, F in Cat2. The display on the storefront for Cat1 would be A, D, B, C because Product D has a sort order of 1 in another category.
I've attached some screenshots. Please note that the categories in the screen shots are subcategories under a top category.
Thanks - sorry for going on about it. This was a big selling point for my superiors in getting them to buy new e-commerce software.
Dappy
Re: Products Not Showing in order as they appear in admin
Posted: Tue Feb 17, 2009 9:44 am
by mazhar
Ok this is confirmed. The problem occurs with the order of those products that belong to multiple categories. I have reported the problem.
If you are not going to use the NarowSearch sidebar with your category display page then you can give a try to following workaround.
Edit your App_Code/ProductHelper.cs file and add following method to it
Code: Select all
public static ProductCollection FindProducts(string keywords, string keywords1, int categoryId, int manufacturerId,int vendorId, int maximumSize, int startIndex, string sortExpression)
{
List<Product> products = ProductDataSource.FindProducts(keywords, keywords1, categoryId, manufacturerId, vendorId, BitFieldState.Any, maximumSize, startIndex, sortExpression);
ProductCollection visibleProducts = new ProductCollection();
foreach (Product product in products)
if (product.Visibility == CommerceBuilder.Catalog.CatalogVisibility.Public)
visibleProducts.Add(product);
return visibleProducts;
}
Now edit you category display page and locate the following code
Code: Select all
ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
make it look like
Code: Select all
//ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
ProductList.DataSource = ProductHelper.FindProducts(_Keywords, _Keywords, this.CategoryId, _ManufacturerId,0,_PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
Re: Products Not Showing in order as they appear in admin
Posted: Wed Dec 23, 2009 4:31 pm
by rpb3
mazhar, that did not work for me. Not sure how it would sort by the category order set in the admin since it doesn't ever pull in the category/catalog data.
This is what I did and it seems to be working OK so far on my 7.0.3 site.
I added this to ProductHelper.cs
Code: Select all
public static int CountForCategory(int categoryId)
{
CatalogNodeCollection cnc = CatalogNodeDataSource.LoadForCategory(categoryId);
int productCount = 0;
foreach (CatalogNode cn in cnc)
{
if (cn.CatalogNodeType == CatalogNodeType.Product)
{
Product p = ProductDataSource.Load(cn.CatalogNodeId);
if (p != null && p.Visibility == CommerceBuilder.Catalog.CatalogVisibility.Public)
productCount++;
}
}
return productCount;
}
public static ProductCollection LoadForCategory(int categoryId, int maximumSize, int startIndex)
{
CatalogNodeCollection cnc = CatalogNodeDataSource.LoadForCategory(categoryId);
int productIndex = 0;
int productCount = 0;
ProductCollection products = new ProductCollection();
foreach (CatalogNode cn in cnc)
{
if (cn.CatalogNodeType == CatalogNodeType.Product)
{
Product p = ProductDataSource.Load(cn.CatalogNodeId);
if (p != null && p.Visibility == CommerceBuilder.Catalog.CatalogVisibility.Public)
{
productIndex++;
if (productIndex > startIndex && productCount < maximumSize)
{
products.Add(p);
productCount++;
}
}
}
}
return products;
}
Then on CategoryGrid3.ascx.cs I change the productList.DataSource to be
Code: Select all
ProductList.DataSource = ProductHelper.LoadForCategory(this.CategoryId, _PageSize, (_HiddenPageIndex * _PageSize));
I also had to change the count line from
Code: Select all
_SearchResultCount = ProductDataSource.NarrowSearchCount(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, SortResults.SelectedValue.StartsWith("IsFeatured"));
to
Code: Select all
_SearchResultCount = ProductHelper.CountForCategory(this.CategoryId);
Not sure if there is a better way to do that in 7.0.3 or .4. You are right that this will not work with the NarrowSearch Sidebar but this only displays the items in one category so most of my clients don't want that anyway.
If you see any problems or ways to improve this, let me know.
One additional note: I also removed the sort SortResult drop down from this page. (I just set the visibility to false) this particular client wanted their products to show up in the order they set in the admin and not in any other order.