<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Widget Template (Search Results)</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121388168" />
  <subtitle>Widget Template (Search Results)</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121388168</id>
  <updated>2026-04-04T01:03:09Z</updated>
  <dc:date>2026-04-04T01:03:09Z</dc:date>
  <entry>
    <title>RE: Widget Template (Search Results)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121392901" />
    <author>
      <name>Gennaro Lippiello</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121392901</id>
    <updated>2022-04-05T18:34:35Z</updated>
    <published>2022-04-05T06:55:25Z</published>
    <summary type="html">&lt;p&gt;I did it! this is my code to get specifications:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;&amp;lt;#if entries?has_content&amp;gt;

	&amp;lt;#list entries as curCPCatalogEntry&amp;gt;
		&amp;lt;#assign CPDefinitionLocalService = serviceLocator.findService(&amp;quot;com.liferay.commerce.product.service.CPDefinitionLocalService&amp;quot;)
			
			CPDefinition = CPDefinitionLocalService.getCPDefinition(curCPCatalogEntry.getCPDefinitionId())
			CPDefinitionSpecificationOptionValues = CPDefinition.getCPDefinitionSpecificationOptionValues()
		/&amp;gt;
		
		&amp;lt;#list CPDefinitionSpecificationOptionValues as cpdsov&amp;gt;
			&amp;lt;#assign cpSpecificationOption = cpdsov.getCPSpecificationOption() /&amp;gt;
			&amp;lt;span&amp;gt;${cpSpecificationOption.getTitle(locale)}&amp;lt;/span&amp;gt;
			&amp;lt;span&amp;gt;${cpdsov.getValue()}&amp;lt;/span&amp;gt;
		&amp;lt;/#list&amp;gt;
		
	&amp;lt;/#list&amp;gt;
&amp;lt;/#if&amp;gt;&lt;/code&gt;&lt;/pre&gt;</summary>
    <dc:creator>Gennaro Lippiello</dc:creator>
    <dc:date>2022-04-05T06:55:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Widget Template (Search Results)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121392454" />
    <author>
      <name>Russell Bohl</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121392454</id>
    <updated>2022-04-04T20:15:52Z</updated>
    <published>2022-04-04T20:15:51Z</published>
    <summary type="html">&lt;p&gt;Great! You could make an answer with same content as your last
  comment, then accept it as the answer.&lt;/p&gt;</summary>
    <dc:creator>Russell Bohl</dc:creator>
    <dc:date>2022-04-04T20:15:51Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Widget Template (Search Results)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121392317" />
    <author>
      <name>Gennaro Lippiello</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121392317</id>
    <updated>2022-04-04T16:38:50Z</updated>
    <published>2022-04-04T14:44:50Z</published>
    <summary type="html">&lt;p&gt;I did it! this is the my code to get specifications:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;&amp;lt;#if entries?has_content&amp;gt;

	&amp;lt;#list entries as curCPCatalogEntry&amp;gt;
		&amp;lt;#assign CPDefinitionLocalService = serviceLocator.findService(&amp;quot;com.liferay.commerce.product.service.CPDefinitionLocalService&amp;quot;)
			
			CPDefinition = CPDefinitionLocalService.getCPDefinition(curCPCatalogEntry.getCPDefinitionId())
			CPDefinitionSpecificationOptionValues = CPDefinition.getCPDefinitionSpecificationOptionValues()
		/&amp;gt;
		
		&amp;lt;#list CPDefinitionSpecificationOptionValues as cpdsov&amp;gt;
			&amp;lt;#assign cpSpecificationOption = cpdsov.getCPSpecificationOption() /&amp;gt;
			&amp;lt;span&amp;gt;${cpSpecificationOption.getTitle(locale)}&amp;lt;/span&amp;gt;
			&amp;lt;span&amp;gt;${cpdsov.getValue()}&amp;lt;/span&amp;gt;
		&amp;lt;/#list&amp;gt;
		
	&amp;lt;/#list&amp;gt;
&amp;lt;/#if&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Gennaro Lippiello</dc:creator>
    <dc:date>2022-04-04T14:44:50Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Widget Template (Search Results)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121392293" />
    <author>
      <name>Gennaro Lippiello</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121392293</id>
    <updated>2022-04-04T16:38:39Z</updated>
    <published>2022-04-04T13:01:25Z</published>
    <summary type="html">&lt;p&gt;Hello Russell, thank you for your interest. No, I'm not getting
  troubles because I'm doing it in a Widget Template.&lt;/p&gt;
&lt;p&gt;I actually don't know how to get the specifications list starting
  from a product (CPCatalogEntry object). In particular my question was
  about the widget because in it I have this CPCatalogEntry list:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;&amp;lt;#if entries?has_content&amp;gt;
	&amp;lt;#list entries as curCPCatalogEntry&amp;gt;
	       //do something
	&amp;lt;/#list&amp;gt;
&amp;lt;/#if&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Gennaro Lippiello</dc:creator>
    <dc:date>2022-04-04T13:01:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Widget Template (Search Results)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121389010" />
    <author>
      <name>Russell Bohl</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121389010</id>
    <updated>2022-03-31T20:55:01Z</updated>
    <published>2022-03-31T20:55:00Z</published>
    <summary type="html">&lt;p&gt;Hi Gennaro, is your question really about ow to use the CP services
  and models to get all product specifications, or is there something
  about doing it in a Widget Template for the Search Results widget that
  is giving you trouble? &lt;/p&gt;</summary>
    <dc:creator>Russell Bohl</dc:creator>
    <dc:date>2022-03-31T20:55:00Z</dc:date>
  </entry>
  <entry>
    <title>Widget Template (Search Results)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121388167" />
    <author>
      <name>Gennaro Lippiello</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121388167</id>
    <updated>2022-03-30T20:11:22Z</updated>
    <published>2022-03-30T16:01:46Z</published>
    <summary type="html">&lt;p&gt;Hello, I'm creating a Widget Template (Search Results Template). I'm
  working with CPCatalogEntry and CPDefinitionLocalService classes and
  I'm wondering how to get the list of specifications of a product.&lt;/p&gt;
&lt;p&gt;Liferay Community Edition Portal 7.4.3.13 CE GA13&lt;/p&gt;</summary>
    <dc:creator>Gennaro Lippiello</dc:creator>
    <dc:date>2022-03-30T16:01:46Z</dc:date>
  </entry>
</feed>
