setItemProperties
Synopsis
void setItemProperties(SessionId sessionId,
BItemId itemId,
ItemProperties properties)
throws BasketServiceFault;
See also: SessionId, BItemId, ItemProperties, BasketServiceFault
The setItemProperties operation can be used to set some of the item properties (not the OFML or OCD properties) of the basket item identified by the itemId parameter.
The itemId parameter must identify a basket item which is part of the basket item tree maintained by the basket service for the session specified by the sessionId parameter.
Fields of the passed ItemProperties structure (§ItemProperties), and fields of the FolderProperties (§FolderProperties) and ArticleProperties (§ArticleProperties) structures referenced by the ItemProperties structure, are ignored if
-
they are null,
-
are irrelevant for the basket item’s type, or
-
correspond to read-only properties of the item.
Thus, depending on the item type (§BasketItemType), the following fields, if non-null, are used to set the corresponding item properties:
Folder
folder.namefolder.showSubTotal
Article, Aggregate, PartialPlanning, UserArticle, SetArticle
article.quantity
Setting these properties for a sub-article item actually sets them for the main article item. Setting them for the main article item of a composite article also affects the sub-articles of the composite article (including the sub-articles of sub-articles, if any).
UserArticle, SetArticle
article.manufacturerIdarticle.manufacturerNamearticle.seriesIdarticle.seriesNamearticle.baseArticleNumberarticle.finalArticleNumberarticle.variantCodearticle.shortTextarticle.longTextarticle.featureText
UserArticle
article.currencyarticle.purchasePricearticle.salesPricearticle.packagingInfo
The value of fields that are ignored never causes the operation to fail. The value of the following fields, if not ignored, is validated before any property of the basket item is set, and a failed validation causes the operation to fail before any item property is set:
article.manufacturerId, article.seriesId, article.manufacturerName, article.seriesName
The manufacturer and series IDs, if not empty, must adhere to the constraints specified in §ArticleProperties.
Manufacturer and series names are set for the undetermined language, not for the current project language.
Setting the manufacturer name or series name resets the corresponding ID and vice versa. Furthermore, setting a manufacturer name resets the series ID, but setting the series name does not reset the manufacturer ID (in fact, it is possible to set manufactuer ID and series name in one invocation of setItemProperties). Finally, setting the manufacturer ID does not reset the series name, but setting the series ID and preserving the manufacturer name is not possible as a series ID can’t be set without the manufacturer ID also being set (setting the series ID requires the item to already have a manufacturer ID, or to set the manufacturer ID together with the series ID).
In other words: IDs and names, considered separately for manufacturer and series, are mutually exclusive, and a series ID always requires a manufacturer ID.
While operation setItemProperties ensures that manufacturer and series IDs are syntactically correct, it does not ensure that they are known IDs, nor does a change to the manufacturer ID resets the series ID even though the latter one will most likely no longer be valid within the context of the new manufacturer (it might not have been valid withint the context of the old manufacturer either).
article.currency
The currency must be an ISO 4217 currency code (pseudo-currency code are not supported), even if both the purchase price and sales price are ignored.
article.purchasePrice, article.salesPrice
These fields, if not ignored, require the currency field to contain a valid ISO 4217 currency code (pseudo-currency code are not supported).
A BasketServiceFault is returned if any of the following conditions occurs:
-
The
sessionIdparameter is not a valid string representation of an UUID or does not represent an open session. -
The
itemIdparameter is not a valid string representation of an UUID. -
The
itemIdparameter does not identify an existing basket item. -
The validation of fields, as described above, failed.
-
The attempt to set one of the properties failed due to an internal error.