IProductCatalog::GetCategoryCustomPrice
Use this method to retrieve the custom price and custom price type for a specified custom catalog and category.
Definition
HRESULT IProductCatalog::GetCategoryCustomPrice(BSTRstrCCName,BSTRstrCategoryName,VARIANT*peCustomPrice,VARIANT*pfpCustomPriceAmount);
Parameters
strCCName
[in] A BSTR that contains the name of the custom catalog.
strCategoryName
[in] A BSTR that contains the category name for which the custom price will be returned.
peCustomPrice
[out] A pointer to a VARIANT used to return the type of the custom price. Valid values are from the CatalogCustomPriceEnum enumeration, and are described in the Remarks section below.
pfpCustomPriceAmount
[out] A pointer to a VARIANT used to return the custom price adjustment.
Return Values
This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.
Error Values
This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.
The following table shows the custom COM errors that this method can return.
Constant | Value | Description |
E_CAT_CATEGORY_DOESNT_EXIST | 0x8898001C | The specified category did not exist. |
E_CAT_CUSTOMCAT_DOESNT_EXIST | 0x88980024 | The specified custom catalog did not exist. |
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 peCustomPrice and pfpCustomPriceAmount parameters contain valid data only if the property was accessed successfully.
The following table shows the values of the CatalogCustomPriceEnum enumeration, their associated names, and describes their use.
Name | Value | Description |
cscNoCustomPrice | 0 | The custom price is the same as the base price. |
cscPercentageMultiplier | 1 | The custom price is the base price multiplied by the percentage value in the pfpCustomPriceAmount parameter. |
cscAddFixedAmount | 2 | The custom price is the pfpCustomPriceAmount added to the base price. |
cscReplacePrice | 3 | The custom price is the pfpCustomPriceAmount. |
cscInvalidCustomPrice | -1 | Reserved for future use. |
If the Category has not been specified as a Custom Category then the peCustomPrice parameter and the pfpCustomPriceAmount parameter will be set to 0.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.