cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

product cockpit: splitted widget with categories -> products -> variants

Former Member
0 Likes
478

Hi experts

I plan to extend the product cockpit with a horizontal splitted view:

catalogs/categories -> products -> variants.

What would be the best way to populate the variants-window of an activated base product? In pcm-assortment they use CatalogTreeFilterAdvancedSearchInitializer. But I do not have NavigationNodes, but a base-Product.

Any hints welcome. Thanks, Heiko

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi,

in general ProductModel has the property variants. The simplest way to obtain the variants is to use Property Extractor Widget to read the property variants and connect it with a widget that can handle a collection of item it be the Collection Browser or a Quick List.

I hope this helps.

Cheers, Wojtek

Answers (3)

Answers (3)

Former Member
0 Likes

Now I added a context-populator and initial search stuff used at assortment collection and it works.

I don't understand it, but the result counts. Thanks, Heiko

Former Member
0 Likes

Hi,

please make sure the getVariants is called and if it returns a List (if the type of Collection is different you may need to wrap it).

Cheers, Wojtek

Former Member
0 Likes

sounds good. But unfortunately the collectionbrowser does not get the awaited input.

I debug at DefaultWidgetInstanceManager.sendOutput and it looks quite good:

click at a product at second vessel

--> DefaultWidgetInstanceManager.sendOutput with socketId "focusedItem" data: theFocussedProduct

--> DefaultWidgetInstanceManager.sendOutput with socketId "genericOutput" data: list of VariantProducts

--> end.

Especially the CollectionBrowserController.setList will not be reached 😞

what could be wrong?

My configurations:

 <widget id="pcmbackoffice-triple-hierarchy-view-thirdvessel-collectionBrowser"
     widgetDefinitionId="com.hybris.cockpitng.collectionBrowser" slotId="thirdSlot"
     template="false">
     ..
     <setting key="collectionBrowserConfigCtx">pcmbackoffice-assortment-collection-browser</setting>
     <setting key="gridViewConfigCtx">pcmbackoffice-grid-view</setting>
     <setting key="colConfigCtxCode">pcmbackoffice-listview</setting>
     <virtual-sockets>
         <input id="list" type="java.lang.Object" />
         <output id="selectedItemsToEdit" type="java.lang.Object" />
     </virtual-sockets>
 </widget>

 <widget id="pcmbackoffice-triple-hierarchy-extract-variants" widgetDefinitionId="com.hybris.cockpitng.widgets.common.propextractor"
             slotId="cockpitWidgetChildrenInvisible" template="false">
         <setting key="expression" type="String">#root.getVariants()</setting>
         <setting key="socketDataType_$T" type="String">java.lang.Object</setting>
         <virtual-sockets/>
     </widget>                

 <widget-connection sourceWidgetId="pcmbackoffice-triple-hierarchy-view-secondvessel-collectionbrowser" outputId="focusedItem"
                    targetWidgetId="pcmbackoffice-triple-hierarchy-extract-variants" inputId="genericInput"/>

 <widget-connection sourceWidgetId="pcmbackoffice-triple-hierarchy-extract-variants" outputId="genericOutput"
                    targetWidgetId="pcmbackoffice-triple-hierarchy-view-thirdvessel-collectionbrowser" inputId="list"/>