Create discount criteria

To create discount criteria, you must perform the following:

  1. Get the orders manager.
    Get an instance of the OrdersManager object.
  2. Create new discount criterion.
    Create a new instance of the DiscountCriteria class by calling the CreateDiscountCriteria method.
  3. Associate the criterion with the discount.
    To do this, set the Parent property of the DiscountCriteria instance to the instance of the discount. Then, add the DiscountCriteria instance to the AdditionalCriteria collection of the discount.
  4. Set the properties of the discount criterion.
    Specify either the ID of the role or the ID of the user the criterion applies to. If you want to specify more than one user or role, or combine them, create separate criteria for each ID.
  5. Save the changes.
    Save the changes to the orders manager.

Use the following code samples:

Create discount criterion for a role

Create discount criterion for a user

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?