0

I am using sitecore commerce 10 , I have added the Custom Field in sellable item .I need to display it on the site. I have done the following steps. but custom field is not displayed in solr .

1.Added field to the sellable item using Composer template.

2.Updated the Data Template and refresh the Commerce cache.

3.Added field to C:\inetpub\wwwroot\CommerceMinions_Site\wwwroot\data\Environments\PlugIn.Search.Solr.PolicySet-1.0.0.json

{
 "$type": "Sitecore.Commerce.Plugin.Search.Solr.SolrIndexFieldConfiguration,Sitecore.Commerce.Plugin.Search.Solr",
 "Name": "StringPropertyIndexName",
 "Type": "System.String",
 "Handler": {
   "$type": "Sitecore.Commerce.Plugin.Catalog.ComposerFieldHandler,Sitecore.Commerce.Plugin.Catalog",
   "ComposerSource": {
   "ViewName": "Custom View",
   "PropertyName": "ExchangeDurationNote"
  }
 }
}

4.Added the Patch file

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:search="http://www.sitecore.net/xmlconfig/search/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">

  <sitecore role:require="Standalone or ContentDelivery or ContentManagement" search:require="solr">
    <contentSearch>
      <indexConfigurations>
        <defaultSolrIndexConfiguration type="Sitecore.ContentSearch.SolrProvider.SolrIndexConfiguration, Sitecore.ContentSearch.SolrProvider">
          <fieldMap type="Sitecore.ContentSearch.SolrProvider.SolrFieldMap, Sitecore.ContentSearch.SolrProvider">
            <fieldNames hint="raw:AddFieldByFieldName">
              <field fieldName="ExchangeDurationNote" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" returnType="string" settingType="Sitecore.ContentSearch.SolrProvider.SolrSearchFieldConfiguration, Sitecore.ContentSearch.SolrProvider"/>
            </fieldNames>
          </fieldMap>
        </defaultSolrIndexConfiguration>
      </indexConfigurations>
    </contentSearch>
  </sitecore>
</configuration>

Can anyone suggest me how to display this custom field on the site?

4
  • did you bpptstrap? Oct 18 at 6:21
  • @GauravAgarwal Thankyou for the reply. yes
    – Nithya
    Oct 18 at 6:25
  • @GauravAgarwal Apart from the above mentioned steps, anything I need to add further to display custom field value on the site
    – Nithya
    Oct 18 at 6:54
  • I followed this blog - raghvendracodes.wordpress.com/2020/09/14/…, but this is not adding field from composer but worth taking a look Oct 18 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.