cancel
Showing results for 
Search instead for 
Did you mean: 

Add attributes to existing product type

Former Member
0 Kudos

Hi

I am a bit confused on how to accomplish this.

I want to have a new attribute on the product cockpit when editing a existin product type. And I also want to have this new attribute on the rest response.

I had created a custom extension for OCC and inside myextension-items.xml I added the following:

 <itemtype code="Product" generate="false" autocreate="false">
     <attributes>
         <attribute qualifier="url_key" type="localized:java.lang.String">
             <modifiers read="true" write="true" search="true" optional="true" private="true"/>
             <persistence type="property"/>
         </attribute>
     </attributes>
 </itemtype>

Then compiled and updated. Do I need to do anything else? I don't see the field anywhere.

Thanks for the help

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I would verify that you see your new attribute in the HMC when you look at the Product type. If you don't you might be missing a step in updating the platform.

If you see the attribute, then it's just getting that field displayed in the Product Cockpit and exposing it to the OCC Rest layer.

Here is a guide on extending item types to the OCC web services: https://wiki.hybris.com/display/release5/Extending+Commerce+Web+Services

Check this out on the Cockpit Framework. https://wiki.hybris.com/display/release5/Configuration+of+the+Cockpit+UI

Not sure what version of hybris you are using, but this information might be outdated in version 6.0

Brandon

Former Member
0 Kudos

Hi

Yes, I see the attribute on the HMC under System -> Types.

I am using Hybris 5.5.1 so I can't use the first link.

I also read about a file editorArea_*.xml... Do I have to create this file? (where?) Any other file? I also saw someone mentioning hmc.xml.

Thanks for the help

Former Member
0 Kudos

I'd be surprised if that guide didn't work for 5.5.1 as well, but I'll see if I can find some other examples.

The XML files should be located in your custom cockpit extension in: "mycockpitextension" -> "resources" -> "mycockpitextension-config" -> "cockpitgroup".

If you need to customize the HMC as well, this should help: https://wiki.hybris.com/display/release5/Configuring+the+hMC+Interface

Brandon

Former Member
0 Kudos

Hi Brandon, thanks for the help.

So, after creating my custom cockpit with ycockpit template using "ant extgen", I see the folder but in resources I don't have any *-config subfolder. Should I create it? should I create also cockpitgroup subfolder?

Thanks again

Former Member
0 Kudos

Sorry yes you need to create that folder structure if it's not there. Basically you can use the hybris/bin/ext-templates/yacceleratorcockpits/resources/ as your starting point. In there you should see configuration for all the cockpits. In the /yacceleratorcockpits-config/cockpit directory you should see the default XML config files for reference.

Also check out https://wiki.hybris.com/display/release5/cockpit+Extension+-+Technical+Guide There is so much good information on cockpit configuration/customizaiton.

Brandon