Page 1 of 1

Products in two categories

Posted: Fri Jan 04, 2008 10:19 am
by zenonpham
Has anybody seen this one:

If a product is in two categories, the product detail page will switch to the category that has the lowest CategoryID (in the ac_Categories table) when the product is selected.

This is a problem since the "breadcrumb" trail will change. Also (in our case) the theme changes.

Any ideas?

Posted: Fri Jan 04, 2008 2:52 pm
by AbleMods
I saw that too during my site testing. I ended up reverting to one-category-per-product for other reasons so it never became a factor for me. I haven't seen anyone else mention it in the forums which surprises me.

Wish I had a solution for you - that would really mess up user presentation with themed category designs.

Posted: Fri Jan 04, 2008 4:19 pm
by jmestep
In 5.5 the dual category worked OK because the Category ID was passed in the URL. I experimented in 7 with the C# in the URL and the product retained the category it was in and the breadcrumbs worked OK. For example, the end of one of my URLs is P6C9.aspx.
It might be possible to do something with the rewrite rules, but I'm not into AC7 that deep yet. In the App_Code folder, there is a RewriteURLLookupEngine.cs

Posted: Fri Jan 04, 2008 4:30 pm
by jmestep
I did find this line commented out in the above .cs file
// <add key="-(C|P|W)\(\d+(?:\|\d+)*)\)" (?:C(\d*))?\.aspx(?:\?(.*))?" value="$1/product1.aspxproduct1.aspx?Product_ID=$2&Category_ID=$3&$4" />
But I got this error when I uncommented it:
CS1009: Unrecognized escape sequence

Maybe it's something Able is still working on?

Posted: Fri Jan 04, 2008 4:40 pm
by Will
I haven't had this problem. We've got products belonging to multiple categories and the breadcrumb link changes depending which category page you came from.

Posted: Fri Jan 04, 2008 4:50 pm
by compunerdy
I have the same problem..but I dont use different themes so its not as noticeable.

Posted: Sat Jan 05, 2008 8:55 am
by jmestep
Will, I thought maybe there was a setting in the admin to define rewrite rules. Did you have to make any changes or did yours show C in the URL automatically? Or does it not show C and the breadcrumbs are still OK?

Posted: Sun Jan 06, 2008 5:03 pm
by mitch
Here is my understanding:

For products which are in multiple categories, AbleCommerce uses the 'C' part of the product URL to determine which category is selected to be displayed in the breadcrumbs.

In terms of whether the 'C' part is present in the product URLs, this is dependant on which category template you use. E.g. "Category Grid Page 2" uses the 'C' URLs, wherease "Category Grid Page" (the default) doesn't.

Posted: Mon Jan 07, 2008 6:48 am
by jmestep
Mitch, thanks for this info. I couldn't figure out why it worked for some stores and not for others.