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

Add "sync status" as a search criteria in Product advance search in backoffice.

bidyadhar_tripathy
Participant
1,192

Hi All,

In one of our requirement, we need to add "sync status" as a search criteria in Product advance search in backoffice. User will see 'sync status' as a dropdown search criteria where user can search on either "synced" or "unsynced".

Any pointers on this requirement ?

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member727691
Discoverer
0 Likes

It seems it is impossible with "-backoffice-config.xml" approach, but I made it using Backoffice Products Solr Index. Just added a new facet:

$solrIndexedType = solrIndexedType(identifier)[unique = true, default = 'BackofficeProduct'];

INSERT_UPDATE SolrIndexedProperty; name[unique = true]; $solrIndexedType; type(code); fieldValueProvider; multiValue; includeInResponse[default = false]; facetType(code)[default = 'MultiSelectOr']; facet[default = true]; backofficeDisplayName[lang=en] ; syncStatus ; ; boolean ; syncStatusValueResolver ; false ; ; ; ; Sync Status;

syncStatusValueResolver - this is bean, that extends AbstractValueResolver<ItemModel, Object, Object> and inside it could use logic from com.hybris.backoffice.sync.facades.SynchronizationFacade.isInSync

svintha
Explorer
0 Likes

Hi @Bidyadhar Tripathy we can achieve this by going to the code as below . If we wnated to see how it works for the OOTB code , please go throgh the below file and customize it accordingly as per the project XXX-backoffice-config.xml

If we wanted to display the list drop-down just go thorough the existing configuration search field for product type approvalStatus .

<advanced-search:field name="approvalStatus" selected="false"/>

If the value is selected="true" It would be shown up as an advanced search filed automatically during the product advanced search.

platformbackoffice/resources/platformbackoffice-backoffice-config.xml
 <context type="Product" component="advanced-search" merge-by="type" parent="GenericItem">
        <advanced-search:advanced-search>
            <advanced-search:field-list>
                <advanced-search:field name="code" selected="true" operator="contains"/>
                <advanced-search:field name="name" selected="true" operator="contains"/>
                <advanced-search:field name="catalogVersion" selected="true" operator="equals"/>
                <advanced-search:field name="variantType" selected="true" operator="equals"/>
bidyadhar_tripathy
Participant
0 Likes

Hi Sairam,

My question was for "sync status" as a search criteria in product advance search in backoffice. From your answer "approvalStatus" is an attribute in product model thats why we can define it *config.xml file where as there are no attributes for "sync status" in product model.

svintha
Explorer
0 Likes

Hi @Bidyadhar Tripathy I have assumed that it is an attribute that was custom-defined in the type system during modeling the product . Then this might not work.

torsten_lorenz
Explorer
0 Likes

Hi all, any news regarding a solution using sync status in BO in advanced search?