Skip to content
pCon.configurator onlineDocumentation
Esc
↑↓navigate↵open⌘Jpreview
On this page

mergeBasketArticles

Synopsis

MergeResult mergeBasketArticles{
    string sessionId,
    string[] itemIds,
    ItemSelectionOptions options
}

See also: MergeResult, ItemSelectionOptions

Items to consider for merging are selected using the ‘itemIds’ and item selection ‘options’ parameters. View items are mapped to basket items. Only basket main article items and user article items are considered for merging. Two such items are merged if:

  • they have the same parent
  • they have identical sub-positions (children in basket item tree)
  • they have identical fields and additional texts
  • they are either not part of a set-article, or part of the same set-article
  • they have the same calculations
  • in case of basket main article items with sub-articles:
    • they represent identical composite articles
    • the above conditions hold for matching sub-articles, except that they do not have the same sub-positions

The return value of the operation is of complex type MergeResult and contains elements <addedItems>, <removedItems>, <movedItems> and <updatedItems>, one element for each added, removed, moved and updated item.

Obviously, whenever some merging took place there should be at least one removed and one updated item.

With the current implementation there should never be an added item.

Under certain circumstances there may be moved items. Consider two identical composite articles (A1,B1) and (A2,B2) where A? is the main article and B? the sub-article. They shall all be children of the same parent C. If A1 and A2 are merged and B2 has some child D then D becomes a child of C if A2 is merged into A1, thus D is reported as a moved item. If, on the other hand, A1 is merged into A2 then D does not move.