Developer forum

Forum » PIM » Find products which have a primary product group?

Find products which have a primary product group?

Michael Knudsen
Reply

Hello forum,

- I'm trying to build a query, that should find all products which have one of it's product groups set to primary, but is that possible?

Screenshot below shows this product have a primary group selected:

Br. Michael Knudsen


Replies

 
Nicolai Pedersen
Reply

You can look at the field "Primary group name" - if it has a value, it is set.

 
Michael Knudsen
Reply

Thanks for your quick response Nicolai, but "Primary group name" isn't a field option in DW9.10.17 nor in DW9.12.3 ?

Br. Michael Knudsen

 
Nicolai Pedersen
Reply

Yes, 9.12.0+ only. I can see we made it for you guys!

 
Michael Knudsen
Reply

Sorry Nicolai, but "Primary Group Name" is not available in DW9.12.3! 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Wasn't that the one you added for me? :-)

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Well, now I just want to throw my name in, just to make this more fun :-P

 
Nicolai Pedersen
Reply

It is for all of you! It was made i May. It is part of ProductIndexBuilder and Extender in Dynamicweb.Ecommerce dll

 
Nicolai Pedersen
Reply

Or I have looked the wrong place in git, which is also an option!

 
Michael Knudsen
Reply

It would be nice with a clarification, of the "Primary Group Name" should be available or not.

 
Michael Knudsen
Reply

Working on a DW9.12.9 solution, which have the "Primary Group Name" available in shared queries, but it still dosn't return the expected result. When PIM products are published to the "Espresso shop" without a primary group, they should be shown in the dashboard, but it dosn't work.

What's wrong with my query expression?

 

Br. Michael Knudsen

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi,

If products were created (added or poblished to various groups) or primary group is changed in general way via UI (Ecom/PIM) then index 'Primary Group Name' field always has name of a group except for translated products where the field is not defined. You can check this using the expression with e.g. 'Contains' condition for the field. 

BR, Oleg QA  

 
Michael Knudsen
Reply

Hello Oleg,

- I'm not sure I understand this correctly:
>> index 'Primary Group Name' field always has name of a group except for translated products where the field is not defined.

So if the products are translated, then will the 'Primary Group Name' not be available/not defined? Sounds very strange, why a product translation should affect the 'Primary Group Name'.

 

Br. Michael Knudsen

 
Michael Knudsen
Reply

I have done some further research, and I have seen serveral translated products with a group name in 'Primary Group Name', but I have also seen translated products without any primary group, where the 'Primary Group Name' has a value!

I'll send my results to DW support.

Br. Michael Knudsen

 

You must be logged in to post in the forum