SAP Knowledge Base Article - Preview

2342561 - B2B Accelerator- How to show product reference details such as Product Name, Summary and Price for a product on product detail page

Symptom

How to show product reference details such as Product Name, Summary and Price for a product on product detail page

Below is the code fragment that has been added to productDetailsPanel.tag

<c:forEach items="${productReferences}" var="ref">
<tr>
<td width="20%">${ref.target.summary}</td>
<c:if test="${not empty ref.target.classifications}">
<c:forEach items="${ref.target.classifications}" var="classification">
<c:forEach items="${classification.features}" var="feature">
<c:choose>
<c:when test="${feature.name != 'Service Manual'}">
<td width="20%"><c:forEach items="${feature.featureValues}" var="value" varStatus="status">
<a href="${value.value}" target="_blank">${feature.name}</a>
</c:forEach></td>
<td width="20%">&nbsp;</td>
</c:when>
<c:when test="${feature.name != 'Brochure'}">
<td width="20%">&nbsp;</td>
<td width="20%"><c:forEach items="${feature.featureValues}" var="value" varStatus="status">
<a href="${value.value}" target="_blank">${feature.name}</a>
</c:forEach></td>
</c:when>
<c:otherwise>
<td width="20%">&nbsp;</td>
<td width="20%">&nbsp;</td>
</c:otherwise>
</c:choose>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty ref.target.classifications}">
<td width="20%">&nbsp;</td>
<td width="20%">&nbsp;</td>
</c:if>
<td width="20%">${ref.target.name}</td>
<td width="20%">List Pricedddd:${ref.target.price.value}</td>
</tr>
</c:forEach>

Following code statement is modified in controllers/pages/ProductPageController.java

protected void populateProductDetailForDisplay(final ProductModel productModel, final Model model,

final HttpServletRequest request, final List<ProductOption> extraOptions) throws CMSItemNotFoundException

{

final List<ProductOption> options = new ArrayList<>(Arrays.asList(ProductOption.BASIC, ProductOption.PRICE,

ProductOption.SUMMARY, ProductOption.DESCRIPTION, ProductOption.GALLERY, ProductOption.CATEGORIES,

ProductOption.REVIEW, ProductOption.PROMOTIONS, ProductOption.CLASSIFICATION, ProductOption.VARIANT_FULL,

ProductOption.STOCK, ProductOption.VOLUME_PRICES, ProductOption.PRICE_RANGE, ProductOption.REFERENCES));

.......

}


Read more...

Environment

Hybris Commerce Suite 5.2.0.0

Product

SAP hybris Commerce Suite 5.2

Keywords

b2b, accelerator, prodct, detail, references, price , KBA , CEC-COM-CPS-WEB , CPS Store frontend, Web CMS, Accelerators (SAP Commerce) , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.