_OrderGroup::AddItem
Use this method to add a line item to the specified OrderForm object.
This method adds a line-item dictionary to the given OrderForm (the strOrderFormName parameter). If the strOrderFormName is not supplied, the parameter strOrderFormName defaults to "default"; if "default" does not exist, it is created. This method also increments the aggregated quantity total at the OrderGroup and OrderForm level.
Definition
HRESULT _OrderGroup::AddItem(IDictionary*dictItem,VARIANTstrOrderFormName,long*lpRetVal);
Parameters
dictItem
[in] A pointer to the IDictionary interface that contains the line item information.
strOrderFormName
[in, optional] A VARIANT that specifies the name of the OrderForm to add the item to. Depending on how a site is structured, you may choose to specify the vendor name of the item as the strOrderFormName. (This will result in items from different vendors being added to different OrderForms.)
lpRetVal
[out, retval] A pointer to a long used to return the index at which the item was added.
Return Values
This method returns an HRESULT indicating whether or not it completed successfully. See the Error Values section for more details.
Error Values
This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.
Remarks
The lpRetVal parameter points to valid data only if the method completed successfully.
Note
Each line item that is added should contain a quantity.
If you are using the QueryCatalogInfo component in your pipeline, you will also need:
product_catalog
product_id
product_variant_id (if this is a product variant)
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.