Hi all,
I have to customize the CIF Product List Component to get some extra fields, like description, short description to be displayed.
I haven't been able to find an example of extending the query with complex attributes.
So, what I can do with simple fields is:
productsRetriever.extendProductQueryWith(p -> p.metaDescription());
I can't do the same with complex fields, like
productsRetriever.extendProductQueryWith(p -> p.shortDescription());
The error message I get is [{"message":"Field \"short_description\" of type \"ComplexTextValue\" must have a sub selection."
Any help will be appreciated here.
Thanks
Ruchi
Solved! Go to Solution.
Views
Replies
Total Likes
So, checked for the OOTB complex field,
productsRetriever.extendProductQueryWith(p -> p.shortDescription(item -> item.html())
Views
Replies
Total Likes
You can add complex fields in below mentioned way
productRetriever.extendProductQueryWith(p -> p.addCustomObjectField("shortDescription", i -> i.addField("field1").addField("field2").addField("field3"))
field1, field2, field3 denotes the sub attributes of the field shortDescription
Views
Replies
Total Likes
Thank you. Given short description is not a custom field, will it work?
Views
Replies
Total Likes
So, checked for the OOTB complex field,
productsRetriever.extendProductQueryWith(p -> p.shortDescription(item -> item.html())
Views
Replies
Total Likes
Views
Likes
Replies