IProductCatalog::SetCategoryCustomPrice

Ee796614.c++_off(en-US,CS.10).gifEe796614.vb_on(en-US,CS.10).gif

Use this method to set a custom price rule for a category.

Definition

HRESULT IProductCatalog::SetCategoryCustomPrice(BSTRstrCCName,BSTRstrCategoryName,CatalogCustomPriceEnumeCustomPrice,DOUBLEfpCustomPriceAmount);

Parameters

strCCName

[in] A BSTR that contains the name of the custom catalog template for which this rule will apply.

strCategoryName

[in] A BSTR that contains the name of the category for which a custom price will be set.

eCustomPrice

[in] The type of price adjustment. Valid values are from the CatalogCustomPriceEnum enumeration, and are described in the Remarks section below.

fpCustomPriceAmount

[in] A DOUBLE that contains the custom price adjustment amount.

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 error that this method can return.

Constant Value Description
E_CAT_CATEGORY_DOESNT_EXIST 0x8898001C The 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 SetCategoryCustomPrice method defines a custom pricing rule for a category, and all the immediate child products of that category, in the specified custom catalog. The SetCategoryCustomPrice method does not affect child categories.

If a product exists within multiple categories, each having different custom prices, the custom price will not be applied to that product for either category.

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.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

See Also

ProductCatalog Object

IProductCatalog::GetCategoryCustomPrice


All rights reserved.