---
title: Change default conventions
slug: commerce-connect-14/docs/overriding-default-conventions
docTags: 
createdAt: 2026-07-23T10:25:33.704Z
---

## Catalog content client conventions

To change the default behavior, create a class to override the conventions that are applied. The following example shows what class to inherit from and how to register your implementation.

```csharp
public class MyCatalogContentClientConventions: CatalogContentClientConventions {}
  [ModuleDependency(FindCommerceInitializationModule)]
public class MyCommerceInitializationModule: IConfigurableModule {
  public void ConfigureContainer(ServiceConfigurationContext context) {
    context.Services.AddSingleton<CatalogContentClientConventions, MyCatalogContentClientConventions> ();
  }
  public void Initialize(InitializationEngine context) {}
  public void Uninitialize(InitializationEngine context) {}
}
```

### Remove inventories from being indexed

Inventories get indexed for variants by default. The inventories are part of the variant document and contain information about the inventory in different warehouses.

When the inventory event is triggered, the variant content is re-indexed. By removing the inventories from the variant, the content is not re-indexed on inventory updates.

```csharp
protected override void ApplyIStockPlacementConventions(TypeConventionBuilder<IStockPlacement> conventionBuilder) {
  base.ApplyIStockPlacementConventions(conventionBuilder);
  conventionBuilder
    .ExcludeField(x => x.Inventories());
}
```

### Remove prices from being indexed

Prices are indexed for variants by default and are part of the variant document, containing information about prices for different users and groups.

When a price event is triggered, the variant content is re-indexed. By removing the prices and the default price from the variant, the content is not re-indexed on price updates.

```csharp
protected override void ApplyPricingConventions(TypeConventionBuilder<IPricing> conventionBuilder)
      {
        base.ApplyPricingConventions(conventionBuilder);
        conventionBuilder
            .ExcludeField(x => x.DefaultPrice())
            .ExcludeField(x => x.Prices());
      }
```

### Apply default conventions

This method applies the default conventions. If you want to make a change, override this method, or any of the submethods, and add or remove conventions you need.

```csharp
public override void ApplyConventions(IClientConventions clientConventions)
      {
        ApplyPriceConventions(clientConventions.ForInstancesOf<Price>());
        ApplyPricingConventions(clientConventions.ForInstancesOf<IPricing>());
        ApplyIStockPlacementConventions(clientConventions.ForInstancesOf<IStockPlacement>());
        ApplyProductContentConventions(clientConventions.ForInstancesOf<ProductContent>());
        ApplyAssociationConventions(clientConventions.ForInstancesOf<IAssociating>());
        ApplyCustomerPricingConventions(clientConventions.ForInstancesOf<CustomerPricing>());
        ApplyNodeRelationsConventions(clientConventions.ForInstancesOf<CatalogContentBase>());
        ApplyEntryContentConventions(clientConventions.ForInstancesOf<EntryContentBase>());
        ApplyBundleContentConventions(clientConventions.ForInstancesOf<BundleContent>());
        ApplyPackageContentConventions(clientConventions.ForInstancesOf<PackageContent>());
    
        ChangeConverterForInstancesOf<Money>(clientConventions, new Json.MoneyConverter());
        ChangeConverterForInstancesOf<MarketId>(clientConventions, new Json.MarketIdConverter());
      }
```

### Apply pricing conventions

This method allows for IPricing to be indexed, meaning that the default price and all other prices are indexed with the associated content. You can override this method if you want to change which fields are indexed.

```csharp
protected override void ApplyPricingConventions(TypeConventionBuilder<IPricing> conventionBuilder)
      {
        conventionBuilder
            .IncludeField(x => x.DefaultPrice())
            .IncludeField(x => x.Prices());
      }
```

### Apply price conventions

This method allows excludes the `EntryContent` field from the `Price` object when indexing. Leave this field excluded if you are indexing prices. If you are not indexing prices, you can remove this convention.

```csharp
protected override void ApplyPriceConventions(TypeConventionBuilder<Price> conventionBuilder)
      {
        conventionBuilder
            .ExcludeField(x => x.EntryContent);
      }
```

### Apply stock placement conventions

This method allows for `IStockPlacement` to be indexed, meaning that inventory records are indexed with the associated content. You can override this method if you want to change which fields are indexed.

```csharp
protected override void ApplyIStockPlacementConventions(TypeConventionBuilder<IStockPlacement> conventionBuilder)
      {
        conventionBuilder.IncludeField(x => x.Inventories());
      }
```

### Apply customer pricing conventions

This method allows for `CustomerPricing` objects to be properly indexed. If you are indexing prices, leave this convention as-is. If you are not indexing prices, remove this convention.

```csharp
protected override void ApplyCustomerPricingConventions(TypeConventionBuilder<CustomerPricing> conventionBuilder)
      {
        base.ApplyCustomerPricingConventions(conventionBuilder);
      }
```
