---
title: "MergeMode"
slug: "api/basket/types/mergemode"
sidebar:
  order: 331
---

<a id="ref-90e8eaab3f2c"></a>
<a id="ref-190f0820313d"></a>
<a id="ref-26b7fecac8e1"></a>

## Synopsis

```text
enum MergeMode {
    None,
    Articles,
    Composites,
    CompositesStrict,
    SubArticles,
    Compact,
    ArticlesCompact
}
```

The merge mode is meaningful for views that use display mode `Sorted`. It controls whether or not, and how, identical child items of the same parent are merged into a single item:

**None**

Items are never merged.

**Articles**

All equal basket article items are merged[^1]. Basket article items are considered equal if they have the same configuration (manufacturer and series ID, base article number, variant code, OFML variant code, fields, additional texts, set-article IDs[^2]) and calculation data.

There is usually no need for two article items to have the same quantity to be merged unless the items have a calculation with an item condition (i.e. not a group or header condition) with calculation rule `FixedAmount`.

The current implementation allows merging of main article items of composites with different sets of sub-article items.

**SubArticles**

Only basket sub-article items are merged. Otherwise the criteria for merging are similar to merge mode `Articles`.

Sub-article items of different composites may be merged if they happen to have the same view item as their parent, as may happen if options `expandPartialPlannings` and/or `expandAggregates` are `true`.

**Compact**

Merge mode `Compact` behaves more or less like merge mode `SubArticles`. The difference to merge mode `SubArticles` is as follows:

- - - Expansion of partial plannings and aggregates is always disabled.

    - Article view items that represent sub-article items (merged or not) do not get a position number assigned. Their IDs are never returned by the basket web service. Instead, their article data is returned as part of the item properties of the main article item they belong to.

    - Operation [`getAllItems`](/pCon/configuratorOnline/specs/api/basket/operations/getallitems) returns, in addition to the basket item ID of the referenced main article item, the basket item IDs of all sub-article items of this main article item.

    - Operations [`getPriceCalculationSheet`](/pCon/configuratorOnline/specs/api/basket/operations/getpricecalculationsheet) and [`getPriceCalculationSheets`](/pCon/configuratorOnline/specs/api/basket/operations/getpricecalculationsheets) automatically return group calculations if they are asked to return the calculation for an article view item that represents a partial planning or aggregate with at least one sub-article item.

    - The default value of option `hideSubArticles` of operation [`getGeneratedImage`](/pCon/configuratorOnline/specs/api/basket/operations/getgeneratedimage) defaults to `false` if the operation is called for a main article item.

[^1]: The current implementation does not merge main article items with sub-article items.

[^2]: Both items are either part of the same set-article or are not part of a set-article.
