I'm working on re-doing a datafeed I had for an Able 5 store and want to use the bread crumb path to the product as the feed field category. Like Paintball > Paintball Guns > Spyder
I've been working with code I snagged from a bread crumb trail, but I need to have it show only one category path if the product is in more than one. How would I do that in this code, or would there be a better way to construct it?
{ List<CatalogPathNode> path = CatalogDataSource.GetPath(productCategoryId, false);
category = "";
for (int i = path.Count - 1; i >= 0; i--)
{
category = path.Name + " > ";
}
Thanks
Obtaining bread crumb path for a product for use in datafeed
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Obtaining bread crumb path for a product for use in datafeed
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
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
Re: Obtaining bread crumb path for a product for use in datafeed
What about picking the first category and generating bread crumbs using that
Re: Obtaining bread crumb path for a product for use in datafeed
For example
[/code]
Code: Select all
[code]
Product product = ProductDataSource.Load(167);
List<CatalogPathNode> pathNodeList = CatalogDataSource.GetPath(product.Categories[0], false);
StringBuilder breadCrumbs = new StringBuilder();
foreach (CatalogPathNode cpn in pathNodeList)
breadCrumbs.Append(cpn.Name+">");
if(breadCrumbs.Length > 0)
breadCrumbs.Remove((breadCrumbs.Length - 1), 1);
Response.Write(breadCrumbs.ToString());
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Obtaining bread crumb path for a product for use in datafeed
Thank you, that's just what I was trying to do. I just couldn't figure out how to get the first category.
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
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
Re: Obtaining bread crumb path for a product for use in datafeed
I love watching you guys work - even if I don't understand all of it 

Bob R.
"Bills travel through the mail at twice the speed of checks." -- Steven Wright
"Bills travel through the mail at twice the speed of checks." -- Steven Wright
Re: Obtaining bread crumb path for a product for use in datafeed
Hello,
Instead of using the entire breadcrumb path, how could you get it to display just the category or sub category that the item is in?
Thank you for your help!
Instead of using the entire breadcrumb path, how could you get it to display just the category or sub category that the item is in?
Thank you for your help!
AC 7.0.3 build 13937
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Obtaining bread crumb path for a product for use in datafeed
Try something like pathNodeList.RemoveRange(0,1);
before the
StringBuilder breadCrumbs = new StringBuilder();
I haven't tested it lately, though.
before the
StringBuilder breadCrumbs = new StringBuilder();
I haven't tested it lately, though.
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
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