Skip to content

Instantly share code, notes, and snippets.

namespace Plugin.Demo.ExtendCommerceView
{
using Plugin.Demo.ExtendCommerceView.Policies;
using Sitecore.Commerce.Core;
using Sitecore.Commerce.EntityViews;
using Sitecore.Commerce.Plugin.Catalog;
using Sitecore.Framework.Pipelines;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using System.Reflection;
namespace Plugin.Demo.ExtendCommerceView
{
using Sitecore.Commerce.Core;
using Sitecore.Commerce.EntityViews;
using Sitecore.Framework.Configuration;
using Sitecore.Framework.Pipelines.Definitions.Extensions;
{
"$type": "Plugin.Demo.ExtendCommerceView.Policies.CMServerPolicy,Plugin.Demo.ExtendCommerceView",
"ServerHostName": "http://xp0.sc/"
}
namespace Plugin.Demo.ExtendCommerceView.Policies
{
public class CMServerPolicy : Policy
{
public string ServerHostName { get; set; }
}
}
<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="examplefield" storageType="YES" indexType="UN_TOKENIZED" vectorType="NO" boost="1f" returnType="text" settingType="Sitecore.ContentSearch.SolrProvider.SolrSearchFieldConfiguration, Sitecore.ContentSearch.SolrProvider"/>
</fieldNames>
</fieldMap>
{
"@odata.context": "https://localhost:5000/Api/$metadata#SellableItems/$entity",
"CompositeKey": null,
"CreatedBy": "sitecore\\Admin",
"UpdatedBy": "sitecore\\Admin",
"DateCreated": "2018-11-14T05:18:09.9239529Z",
"DateUpdated": "2018-11-14T05:17:44.2144901Z",
"DisplayName": "Studio X Over-the-Ear Wired Headphones",
"FriendlyId": "6042064",
"Id": "Entity-SellableItem-6042064",
using Newtonsoft.Json.Linq;
using Sitecore.Commerce;
using Sitecore.Commerce.Engine.Connect;
using Sitecore.Commerce.Engine.Connect.DataProvider;
using Sitecore.Commerce.Engine.Connect.Search.ComputedFields;
using Sitecore.ContentSearch;
using Sitecore.Data;
using Sitecore.Data.Items;
using System.Collections.Generic;