cancel
Showing results for 
Search instead for 
Did you mean: 

Show newly added attribute on storefront

0 Kudos
624

help me creating a new attribute in an existing product table and add the data in it through impex and display the values of product id, product name and the new attribute in the storefront under myaccount

Accepted Solutions (0)

Answers (2)

Answers (2)

gaurav11
Participant

Hi Mayank,

You have to follow below step.

1. In your custom core extension, customcore-items.xml file will be there, you need to add your attribute as below.

<itemtype code="Product" autocreate="false" generate="false">

<attributes>

<attribute qualifier="newattribute" type="typw">

<modifiers read="true" write="true" search="true"

optional="true"/>

<persistence type="property"/>

</attribute>

</attributes>

</itemtype>

2. You have to add a new property in ProductData object as per below, in customfacades-beans.xml

<bean class="de.hybris.platform.commercefacades.product.data.ProductData">

<property name="productTypeName" type="java.lang.String"/>

</bean>

3. Do a system build and update the system.

4. Create a populator with implementing " Populator<ProductModel, ProductData>" Add populator and add it to existing converter in the customfacades-spring.xml

5. Add newly created property to your JSP file, where you want to show the same.

0 Kudos

Thank You for the help, I will try this out.

safin
Product and Topic Expert
Product and Topic Expert

Hi Mayank,

i just show you a high level process to introduce new product attribute in your storefront

  1. create a new extension
  2. define the new attribute for Product type in <extensionname>-items.xml
  3. define the new property for ProductData in <extensionname>-beans.xml
  4. build and update SAP Commerce system
  5. develop a populator, which is used to get the value of this new attribute from ProductModel and set it to the new property in ProductData
  6. configure this populator and add it to existing converter in the <extensionname>-spring.xml
  7. if you are using traditional accelerator as the storefront, update product related jsp to use this new property (of ProductData) in the view
  8. if you are using SAP Commerce cloud composable storefront (or spartacus) as the storefront, develop customized angular component (which will show new attribute) to replace the old one.

Hopefully it can help you a little.

Thanks

0 Kudos

Thank You for the help, I will try this out.