Kopīgot, izmantojot


CatalogPricingRuleType Enumeration

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Specifies catalog pricing rules.

Namespace:  Microsoft.CommerceServer.Catalog
Assembly:  Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)

Syntax

'Declaration
Public Enumeration CatalogPricingRuleType
'Usage
Dim instance As CatalogPricingRuleType
public enum CatalogPricingRuleType
public enum class CatalogPricingRuleType
public enum CatalogPricingRuleType

Members

Member name Description
NoPriceChange Price is not changed.
PercentageMultiplier Price is incremented by the specified percentage.
AddFixedAmount Price is incremented by the specified fixed amount.
ReplacePrice Price is reset to the specified amount.

Remarks

When you make a price change to a product, you can apply price rules to catalog products using this enumerator. You can apply the following four types of price rules:

  • AddFixedAmount. Adds the amount specified by priceChange to the price of the catalog item in the base catalog.

  • NoPriceChange. The price of the catalog item in the base catalog remains unchanged.

  • PercentageMultiplier. Adds the percentage amount specified by priceChange to the price of the catalog item in the base catalog. The priceChange can be less than zero to discount the price of the catalog item in the base catalog. The final price = base price + base price * PercentageMultiplier/100. To provide for a 10 percent discount on a product set the PercentageMultiplier to -10.

  • ReplacePrice. Sets the price of the catalog item in the base catalog to priceChange to the price of the product in the base catalog.

Examples

VirtualCatalog vc = (VirtualCatalog)this.catalogContext.GetCatalog(virtualCatalogName);
// Add a rule to the base catalog by caling the AddVirtualCatalogRule method
// Set the last parameter to true to add an inclusion rule.
// To add an exclusion rule set the last paremeter to true
vc.AddVirtualCatalogRule(baseCatalog, null, null, null, false);
// To add a price rule call the AddPriceRule method
vc.AddPriceRule(baseCatalog, null, null, null, CatalogPricingRuleType.PercentageMultiplier, 10);
// Call save to save the rules to the catalog system
vc.Save();

// Iterating through a rules collection
VirtualCatalogRuleCollection  vcRules = vc.VirtualCatalogRules;
foreach (VirtualCatalogRule vcRule in vcRules)
{
  Console.WriteLine(vcRule.CatalogName);
}

// Iterating through a pricerules collection
PricingRuleCollection vcPriceRules = vc.PriceRules;
foreach (PricingRule vcPriceRule in vcPriceRules)
{
  Console.WriteLine(vcPriceRule.CatalogName);
}

See Also

Reference

Microsoft.CommerceServer.Catalog Namespace