<?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>Custom Product Renderer</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114249454" />
  <subtitle>Custom Product Renderer</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114249454</id>
  <updated>2026-04-04T17:12:48Z</updated>
  <dc:date>2026-04-04T17:12:48Z</dc:date>
  <entry>
    <title>RE: RE: Custom Product Renderer</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122242956" />
    <author>
      <name>Ashish Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122242956</id>
    <updated>2023-11-16T21:20:06Z</updated>
    <published>2023-11-16T07:40:20Z</published>
    <summary type="html">&lt;p&gt;I used the same code for product publisher but instead of product
  publisher custom renderer is working with product details&lt;br&gt; product
  publisher -&amp;gt; configuration -&amp;gt; setup -&amp;gt; render selection
  -&amp;gt; PRODUCT TYPE RENDERER -&amp;gt; Simple -&amp;gt; only default is coming&lt;/p&gt;
&lt;p&gt;Product detail -&amp;gt; configuration -&amp;gt; render selection
  -&amp;gt; CUSTOM RENDERER -&amp;gt; custom, custom product renderer &lt;/p&gt;
&lt;p&gt;so it's working with Product details, not with product publisher, is
  it expected ?&lt;img alt="" src="/documents/d/guest/screenshot-from-2023-11-16-13-07-41-png?imagePreview=1"&gt;
  &lt;img alt="" src="/documents/d/guest/screenshot-from-2023-11-16-13-09-41-png?imagePreview=1"&gt;
  &lt;br&gt;  &lt;/p&gt;</summary>
    <dc:creator>Ashish Kumar</dc:creator>
    <dc:date>2023-11-16T07:40:20Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom Product Renderer</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114269534" />
    <author>
      <name>Joshua St. Clair</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114269534</id>
    <updated>2019-07-12T17:15:42Z</updated>
    <published>2019-07-12T17:15:42Z</published>
    <summary type="html">Hey Tom,&lt;br /&gt;&lt;br /&gt;Sorry that you&amp;#39;re still having trouble. I went ahead and uploaded my code for you in this github repository. It has the minimum amount of code you need to get your own Custom Product Renderer working. I hope referencing it helps you solve your issues and clarifies what needs to be overridden and extended.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://github.com/JoshuaStClair/liferay-module-examples/tree/master/modules/commerce-custom-product-renderer"&gt;https://github.com/JoshuaStClair/liferay-module-examples/tree/master/modules/commerce-custom-product-renderer&lt;/a&gt;</summary>
    <dc:creator>Joshua St. Clair</dc:creator>
    <dc:date>2019-07-12T17:15:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom Product Renderer</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114265102" />
    <author>
      <name>Marco Leo</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114265102</id>
    <updated>2019-07-12T10:31:16Z</updated>
    <published>2019-07-12T10:31:16Z</published>
    <summary type="html">Hi TomCPContentListRenderer and CPContentListEntryRenderer  can be used in combination or singularly.&lt;br /&gt;CPContentListRenderer takes care of organizing the list of products, like in a grid, list, carousel, table,  and so on.&lt;br /&gt;CPContentListEntryRenderer takes care to render the single product abstract template in the list organized by the CPContentListRenderer.&lt;br /&gt;CPContentRenderer is used to render the product just in the Product Detail Portlet.&lt;br /&gt;This combination allows you to be able to reuse the same implementation of your product in different portlets: search results, product publisher, compare list.&lt;br /&gt;Let me know if this clarifies the differentiation. &lt;br /&gt;ThanksMarco</summary>
    <dc:creator>Marco Leo</dc:creator>
    <dc:date>2019-07-12T10:31:16Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom Product Renderer</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114263203" />
    <author>
      <name>Tom Jacobs</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114263203</id>
    <updated>2019-07-12T06:40:38Z</updated>
    <published>2019-07-12T06:40:38Z</published>
    <summary type="html">Ok, I discovered some more:&lt;br /&gt;&lt;br /&gt;I was trying to create a Product List Renderer this time, implementing the CPContentListRenderer interface (again, didnt get it to work), but I also discovered that there is a CPContentListEntryRenderer. Maybe this is what I was looking for in the first place, since it acctualy apears in the dropdown under &amp;#34;Product Type Renderer&amp;#34;. I&amp;#39;m still not entirely sure when to implement which interface, and what the required properties are, but it&amp;#39;s a start.</summary>
    <dc:creator>Tom Jacobs</dc:creator>
    <dc:date>2019-07-12T06:40:38Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom Product Renderer</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114261502" />
    <author>
      <name>Tom Jacobs</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114261502</id>
    <updated>2019-07-12T05:39:56Z</updated>
    <published>2019-07-12T05:39:56Z</published>
    <summary type="html">Hi Joshua,&lt;br /&gt;&lt;br /&gt;Thank you for your quick reply. I have added the line to my bnd.bnd file, but still no result. This is what my bnd.bnd file looks like now:&lt;br /&gt;&lt;br /&gt;Bundle-Name: amatron-books-renderer&lt;br /&gt;Bundle-SymbolicName: be.amatron.books.renderer&lt;br /&gt;Bundle-Version: 1.0.0&lt;br /&gt;&lt;br /&gt;Web-ContextPath: /amatron-books-renderer&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I also added a screenshot of my folder structure, maybe there is something wrong there?&lt;br /&gt;&lt;br /&gt;Edit: I did spot a mistake myself: the folder for my view.jsp should be &amp;#34;render&amp;#34; and not &amp;#34;renderer&amp;#34;, but still I cannot find my custom renderer for the Product Publisher</summary>
    <dc:creator>Tom Jacobs</dc:creator>
    <dc:date>2019-07-12T05:39:56Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom Product Renderer</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114256805" />
    <author>
      <name>Joshua St. Clair</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114256805</id>
    <updated>2019-07-11T16:29:47Z</updated>
    <published>2019-07-11T16:29:47Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Tom,&lt;br&gt;&lt;br&gt;I feel your pain. I too struggled implementing my own custom product renderer.&amp;nbsp;&lt;br&gt;&lt;br&gt;I discovered that the documentation leaves out an important line. In your bnd.bnd, you need to specify a Web-ContextPath&amp;nbsp;with your module name. In my case, my module was called&lt;em&gt;&amp;nbsp;wholesale-product-renderer&amp;nbsp;&lt;/em&gt;so the line was:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;Web-ContextPath: /wholesale-product-renderer&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Hopefully that is the missing piece for you like it was for me.&lt;br&gt;&lt;br&gt;Let me know what your findings are.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Joshua St. Clair</dc:creator>
    <dc:date>2019-07-11T16:29:47Z</dc:date>
  </entry>
  <entry>
    <title>Custom Product Renderer</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114249453" />
    <author>
      <name>Tom Jacobs</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114249453</id>
    <updated>2019-07-11T12:54:04Z</updated>
    <published>2019-07-11T12:54:04Z</published>
    <summary type="html">Hi,&lt;br /&gt;I&amp;#39;m trying to create a Custom Product Renderer. I followed these steps from the documentation (which is very limited IMO), but no success: https://commerce.liferay.dev/developer-guide/-/knowledge_base/developer/creating-a-custom-product-renderer&lt;br /&gt;This is the code for my Custom Renderer class:&lt;br /&gt;&lt;br /&gt;@Component(&lt;br /&gt;    immediate = true,&lt;br /&gt;    property = {&lt;br /&gt;        &amp;#34;commerce.product.content.renderer.key=&amp;#34; + BooksRenderer.KEY,&lt;br /&gt;        &amp;#34;commerce.product.content.renderer.order=&amp;#34; + Integer.MIN_VALUE,&lt;br /&gt;        &amp;#34;commerce.product.content.renderer.type=&amp;#34; + SimpleCPTypeConstants.NAME&lt;br /&gt;    },&lt;br /&gt;    service = CPContentRenderer.class&lt;br /&gt;)&lt;br /&gt;public class BooksRenderer implements CPContentRenderer {&lt;br /&gt;&lt;br /&gt;    public static final String KEY = &amp;#34;MyKey&amp;#34;;&lt;br /&gt;&lt;br /&gt;    @Reference&lt;br /&gt;    private BooksRendererViewHelper viewHelper;&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public String getKey() {&lt;br /&gt;        return KEY;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public String getLabel(Locale locale) {&lt;br /&gt;        ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(&lt;br /&gt;            &amp;#34;content.Language&amp;#34;, locale, getClass());&lt;br /&gt;&lt;br /&gt;        return LanguageUtil.get(resourceBundle, KEY);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public void render(CPCatalogEntry cpCatalogEntry, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {&lt;br /&gt;        httpServletRequest.setAttribute(&lt;br /&gt;            BooksRendererConstants.VIEW_HELPER, viewHelper);&lt;br /&gt;&lt;br /&gt;        _jspRenderer.renderJSP(_servletContext, httpServletRequest, httpServletResponse, &amp;#34;/render/view.jsp&amp;#34;);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Reference&lt;br /&gt;    private JSPRenderer _jspRenderer;&lt;br /&gt;&lt;br /&gt;    @Reference(&lt;br /&gt;        target = &amp;#34;(osgi.web.symbolicname=be.amatron.books.renderer)&amp;#34;&lt;br /&gt;    )&lt;br /&gt;    private ServletContext _servletContext;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My view.jsp page atm is just an empty page saying &amp;#34;test&amp;#34;&lt;br /&gt;&lt;br /&gt;In the Product Publisher I can however not select my new, custom renderer.&lt;br /&gt;&lt;br /&gt;What am I missing?</summary>
    <dc:creator>Tom Jacobs</dc:creator>
    <dc:date>2019-07-11T12:54:04Z</dc:date>
  </entry>
</feed>
