Adding Custom Promotion Validators and Calculators

Parallels H-Sphere allows to define custom promotions - flexible discount systems - and assign them for individual plans.

Usually, a customer enters a certain promotion code on signup, the system verifies the entered code if it proves to be valid and corresponds to the chosen plan, that user signs up with that discount. This is called a codeable promotion. There are also codeless promotions that don't require a code. Discount depends on a particular promotion and the way the discount is calculated.

This document explains how to add and configure custom promotion validators and calculators.

To add a custom promotion validator or calculator to Parallels H-Sphere:

  1. Log into the CP server as the cpanel user.
  2. Create a custom promotion validator or calculator:
  3. Configure custom promotion validator or calculator in the XML configuration file.

    All promotion validators and calculators should be added to and configured in the promotions.xml file. Its default location is ~cpanel/shiva/psoft/hsphere/promotion/xml/. The file location can be altered with the PROMO_CONFIG and CUSTOM_PROMO_CONFIG properties in ~cpanel/shiva/psoft_config/hsphere.properties:

    PROMO_CONFIG=/hsphere/local/home/cpanel/shiva/psoft/hsphere/promotion/xml/promotions.xml

    CUSTOM_PROMO_CONFIG=/hsphere/local/home/cpanel/shiva/custom/xml/promotions.xml

    promotions.xml should be customized according to XML customization rules.

DTD Structure: http://hsphere.parallels.com/HSdocumentation/xmls/promotions.dtd

Example: http://hsphere.parallels.com/HSdocumentation/xmls/promotions.xml

Elements and attributes: