Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Search Results Template and default image URL
Hello everyone,
I'm creating a Widget Template (Search Results Template).
I'm working with CPCatalogEntry class and I'm wondering how can I get the url of default image. Unfortunately the method CPCatalogEntry.getDefaultImageFileUrl() doesn't work in my Liferay version (Liferay Community Edition Portal 7.4.3.13 CE GA13)
UPDATE
I was able to get the URL in this way:
<#assign CPDefinitionLocalService = serviceLocator.findService("com.liferay.commerce.product.service.CPDefinitionLocalService")
CPAttachmentFileEntry = CPDefinitionLocalService.getDefaultImageCPAttachmentFileEntry(curCPCatalogEntry.getCPDefinitionId())
FileEntry = CPAttachmentFileEntry.fetchFileEntry()
DLUtil = staticUtil["com.liferay.document.library.kernel.util.DLUtil"]
imageURl = DLUtil.getPreviewURL(FileEntry, FileEntry.getFileVersion(), themeDisplay, "")
/>
Now I have another problem, how can I get the list of specification of a product?