Hey guys!
I got a eCom shop with a few groups. Some of these groups have two parent groups. When listing those as a eCom navigation, and clicking one of those with 2 parent groups, it always selects the first parent group. This means that if I click on the last of the parent groups, the first will get the inpath class.
I'm searching for a quick solution instead of making 2 separate groups.
Is this possible? If so, how would you do it?
Thanks in advance for the help on this matter! :-)
Developer forum
E-mail notifications
eCom navigation - sub group with two parent groups
Jackie Nagel
Posted on 24/05/2012 14:16:57
Replies
Mikkel Ricky
Posted on 06/06/2012 11:47:38
I've been looking into this as well. My immediate though was that we need some sort of alias functionality to accomplish this, i.e. that a group can act like another and – in this case – show products from another group. This way all groups will have unique urls and navigation paths &c. will work as expected.
I'm new to Dynamicweb, but reading another forum discussion about ProductListCollectionProvider made me realise that this should actually be possible to do, and one way to do it is like this:
First, create a new Product Group Field with System Name "groupalias" (or whatever you prefer)
Second, add a custom ProductListCollectionProvider that checks the new custom field, and returns products form the aliased group if it exists [http://developer.dynamicweb-cms.com/api8/topic1950.html]:
Now, you can add a new group that acts as an alias of (shows products from) another group (rather that using the group Location).
There might be better ways to do this, but the approach outlined above seems to be one way to go, and I hope you can make use of it.
Best regards,
Mikkel
I'm new to Dynamicweb, but reading another forum discussion about ProductListCollectionProvider made me realise that this should actually be possible to do, and one way to do it is like this:
First, create a new Product Group Field with System Name "groupalias" (or whatever you prefer)
Second, add a custom ProductListCollectionProvider that checks the new custom field, and returns products form the aliased group if it exists [http://developer.dynamicweb-cms.com/api8/topic1950.html]:
using System; using Dynamicweb.Extensibility.Provider; using Dynamicweb.eCommerce.Products; namespace CustomModules.CustomModules.CustomProductListCollectionProvider { public class CustomProductListCollectionProvider : ProductListCollectionProvider { public override ProductCollection FetchCollection(Dynamicweb.eCommerce.Frontend.Renderer renderer, string groups) { ProductCollection products = null; Group group = Group.GetGroupByID(groups); if (group != null) { foreach (ProductGroupFieldValue field in group.ProductGroupFieldValues) { if (field.HasValue && (field.ProductGroupField.SystemName == "groupalias")) { Group aliasGroup = Group.GetGroupByID(field.Value.ToString()); if (aliasGroup != null) { products = aliasGroup.Products; } break; } } } return products; } } }
Now, you can add a new group that acts as an alias of (shows products from) another group (rather that using the group Location).
There might be better ways to do this, but the approach outlined above seems to be one way to go, and I hope you can make use of it.
Best regards,
Mikkel
Peter Bille Larsen
Posted on 06/06/2012 13:06:28
Hi Mikkel
The problem is primarily that the product group is inserted into 2 parent groups.
Then the navigation will show the one thats created as the newest one in the system.
ie:
Sportswear > Adidas > Shoes
Shoes > Adidas > Shoes
In this example the navigation unfolds the number 2 example if you step through number 1.
We cannot allow more than one product group with the same content, because that would force the client to maintain 2 groups with SEO and make confusion.
The solution might be to make some sort of notification which logs which path is being unfolded, and corrects for "jump" in the menu.
Mikkel Ricky
Posted on 07/06/2012 16:25:23
The problem with having the same product group in two (or more) parent categories is that there's more than one navigation path, i.e. sequence of clicks from frontpage, to the same destination (the group's unique url). There is no way for the system to know how the user has arrived at the destination, and then it has to choose some path to display – and this path will sometimes be the wrong one.
My suggested solution works around this problem by allowing an empty product group to show products from another, and this creates unique urls for each node in the navigation tree. The products only exist in one group and only has to be maintained in one place. However, it might be a SEO problem having two urls with the same content.
If I understand your suggestion with some notification logging correctly, the idea is the keep track of how the user has navigated to the product group. This will probably require a lot of work and it will only work when a user always manually unfolds the entire path. Any direct links to the product group, e.g. from a browser bookmark, will still have no information on how the path was originally unfolded (unless the entire path is stored in the url).
My suggested solution works around this problem by allowing an empty product group to show products from another, and this creates unique urls for each node in the navigation tree. The products only exist in one group and only has to be maintained in one place. However, it might be a SEO problem having two urls with the same content.
If I understand your suggestion with some notification logging correctly, the idea is the keep track of how the user has navigated to the product group. This will probably require a lot of work and it will only work when a user always manually unfolds the entire path. Any direct links to the product group, e.g. from a browser bookmark, will still have no information on how the path was originally unfolded (unless the entire path is stored in the url).
Peter Bille Larsen
Posted on 08/06/2012 08:39:00
True. We have had the same issue with another ecom system.
We solved the direct link problem by adding a checkbox on the product group and called "MasterLink", so if all else fails, the system would show the path to the master group.
I know that this feature is in the feature request: (primary group )
http://developer.dynamicweb-cms.com/forum/feature-requests/productgroupid.aspx
You must be logged in to post in the forum