Developer forum

Forum » Development » List of Groups, of eCom module paragraht

List of Groups, of eCom module paragraht

Dmitrij Jazel
Reply

Hello guys,

I have a paragraph with Ecom module added to it, and I have added some Ecom groups to it. (see attachment)

my question is, while I am in ProductList template, is there is any way that I could get a List of groups that are selected there?

While not having "Groups" select box selected?

 

Cause I can choose selectbox Groups, but than product catalog will attempt rendering groups template.

Should not be very hard to do that (hopefully) :-)

Otherwise, could be a great feature request?

 

/Dmitrij

Ecom_Paragraph_Groups.png

Replies

 
Mikkel Ricky
Reply
This post has been marked as an answer

Razor is your friend (as always) and so it the Dynamicweb API:

@{
var paragraphId = Pageview.CurrentParagraph.ID;
var properties = Dynamicweb.Base.GetParagraphModuleSettings(paragraphId);
var handler = new Dynamicweb.Extensibility.ProductsAndGroupsHandler(properties["ProductAndGroupsSelector"]);
}

@foreach (var group in handler.GroupsSelected) {
@: @group.ID: @group.Name
}

Best regards,
Mikkel

Votes for this answer: 1
 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Alternatively, you could use a product list template extender to render the group ids into the template: http://developer.dynamicweb.com/documentation/for-developers/ecommerce/extensibility/template-extenders.aspx

- Jeppe

 
Dmitrij Jazel
Reply
SWEET! :) 
 ____ ____ ____ _________ ____ ____ ____ ____                     
||Y |||o |||u |||       |||g |||u |||y |||s ||                    
||__|||__|||__|||_______|||__|||__|||__|||__||                    
|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|/__\|                    
 ____ ____ ____ _________ ____ ____ ____ ____ ____ ____ ____ ____ 
||a |||r |||e |||       |||a |||w |||e |||s |||o |||m |||e |||! ||
||__|||__|||__|||_______|||__|||__|||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|
 
Dmitrij Jazel
Reply

One last thing though, regarding ProductAndGroupsSelector, 

Is there any way I could browse or have some kind of overview over  not only ProductAndGroupsSelector but also other ProductsAndGroupsHandler that are there in DW? :)

I guess if I need to get selected shop reference, than I have to call for "ShopSelector" probably?

 

You must be logged in to post in the forum