Developer forum

Forum » Development » Show products or subgroups of selected group

Show products or subgroups of selected group


Reply
Our customer have a ecom group-structure like this:

-Plasma Freeezers
-+Product 1 of Plasma Freezers
-+Product 2 of Plasma Freezers
-Pharmaceutical Refrigerators
--Subgroup 1 of Pharmaceutical Refrigerators
--+Product 1 of Subgroup 1
--+Product 2 of Subgroup 1

Plasma Freeezers and Pharmaceutical Refrigerators are to firstlevel groups of the shop.

The first group has products directly put in the group but the group "Pharmaceutical Refrigerators" have two subgroups and the products are in these two subgroups.

When I list the groups in frondend and choose Plasma Freeezers I get i nice list of the products in this group. If I click the group Pharmaceutical Refrigerators, I get the message "No products" because there no products directly in the group but in its subgroups.

How can I list the subgroups indstead of the "No products". I can't find anything on a way to loop through subgroups or similar.

The same question have been posted before:
http://engage.dynamicweb-cms.com/Forum-5.aspx?action=ShowThread&ThreadID=779

It says it's gonna be possible but doestn't answer how and I can't find anything in the manual regarding this.

Best regards
Jesper Sørensen

Replies

 
Nicolai Høeg Pedersen
Reply
You can do that by using the grouplist template on the catalog settings on the paragraph:
http://manual.net.dynamicweb.dk/Dynamicweb-eCommerce/Modules/Product-Catalog/Paragraph-settings/Product-groups.aspx
 
Reply
Yes, and it works for showing the groups I have selected. But when one of the groups are clicked it can not show the subgroup of the group i just clicked. It tries to show the products in this group, but some of the groups only contains subgroups (with products in these subgroups) and the subgroups can not be listed.

I can select all groups and subgroups in the settings on the paragaph but then all groups are shown one the same level.

I want the user to click one group. if this group contains subgroups, list them and the user can click the subgroup and then get the list of products in the subgroup.
 
Nicolai Høeg Pedersen
Reply

That is missing from standard functionality - you can make a very simple add on though:

 

VB:
Public Class RenderSubGroups
                             Inherits eCommerce.Products.ProductListTemplateExtender
                             Public Overrides Sub ExtendTemplate(ByVal template As Templatev2.Template)
                                                          If Not String.IsNullOrEmpty(Base.Request("GroupID")) Then
                                                                                       Dim group As eCommerce.Products.Group = New Group(Base.Request("GroupID"))
                                                                                       Dim render As new eCommerce.Frontend.Renderer
                                                                                       render.RenderGroups(group.Subgroups, template, "Subgroups")
                                                          End If
                             End Sub
End Class
 
C#:
public class RenderSubGroups : eCommerce.Products.ProductListTemplateExtender
{
        public override void ExtendTemplate(Templatev2.Template template)
        {
                 if (!string.IsNullOrEmpty(Base.Request("GroupID"))) {
                          eCommerce.Products.Group @group = new Group(Base.Request("GroupID"));
                          eCommerce.Frontend.Renderer render = new eCommerce.Frontend.Renderer();
                          render.RenderGroups(@group.Subgroups, template, "Subgroups");
                 }
        }
}
 
Nicolai Høeg Pedersen
Reply
It has now been "bugged" as TFS5471. Fix is ready and will be released with next hotfix (19.1.1.1).
 
Reply
So, it will be possible to show subgroups when the next bugfix is released?

When do you think that will be?

 

You must be logged in to post in the forum