Personal tools


Discount Center For WHMCS

From ModulesGarden Wiki
Jump to: navigation, search


About Discount Center For WHMCS

Discount Center For WHMCS module allows you to set up discounts for products ordered in a specified combination or quantity.
It will let you define discount rules and validity periods as well as exclude certain clients from being offered price cuts or promote new customers only!
  • Admin Area:
✔ Create Multiple Discounts For Products, Domains And Product Addons
✔ Create Multiple Quantity Discounts With Several Thresholds For Products, Domains And Product Addons
✔ View Discounts Summary
✔ View Discount Logs
  • Client Area:
✔ View Before And After Discount Item Prices
✔ Build Your Own Discounted Product Bundle
  • Discounts:
✔ Define Items To Apply Discount To
✔ Define Discounts For Chosen Items Per Billing Cycle
✔ Define Items Required In Cart To Apply Discount
✔ Define Items Required To Be Owned By Client To Apply Discount
✔ Define Clients To Whom Discount Should Be Applied:
✔ All Clients And Guests
✔ New Clients
✔ Chosen Clients And Client Groups
✔ Define If Discount Should Be Applied One Time Or Recurring
✔ Define Time Period For Recurring Discount
✔ Define Discount Validity Period
✔ Define If Discount Should Be Applied When Product Bundles Are Enabled
  • Quantity Discounts:
✔ Define Multiple Promotion Thresholds And Discount Values
✔ Define Items To Be Summed Up And Compared With Thresholds
✔ Define Items Required To Be Owned By Client To Apply Discount
✔ Choose Type Of Discount Application:
✔ All Specified Items
✔ More Expensive Than Specified Value
✔ Less Expensive Than Specified Value
✔ Chosen Products/Addons/Domains
✔ Number Of Active Services
✔ Choose Clients To Which Discount Should Be Applied:
✔ All Clients and Guests
✔ New Clients
✔ Chosen Clients And Client Groups
✔ Define If Discount Is Of One Time Or Recurring Type
✔ Define Time Period For Recurring Discount
✔ Define If Products With 'Allow Multiple Quantities' Should Be Supported
✔ Define If Discount Should Be Applied Along With Promotion Code
✔ Define Discount Validity Period
✔ Define If Discount Should Be Applied When Product Bundles Are Enabled
  • Early Payment Discounts:
✔ Define Number Of Days Of Discount Validity
✔ Define Items To Apply Discount To
✔ Define Discounts For Chosen Items Per Billing Cycle
✔ Define Email Notifications:
✔ On Invoice Creation
✔ On Discount Expiration
✔ Discount Cancelation Reminders With Defined Number Of Days Before Expiration
  • General Info:
✔ Integrated with Product Cross-Selling For WHMCS - View Discounts Applied To Related And Recommended Products
✔ Recognize Unlogged Client Identity To Assign Discount Accordingly
✔ Updates Amounts On Unpaid Invoices Dynamically When 'Active Services Quantity' Discount Is Used
✔ Supports Default And Custom Order Forms
✔ Supports PHP 7.2 Up To PHP 7.4
✔ Supports WHMCS Themes "Six" And "Twenty-One"
✔ Supports WHMCS V7.10 And Later
✔ Easy Module Upgrade To Open Source Version


This tutorial will show you how to successfully install and configure Discount Center For WHMCS.

We will guide you step by step through the whole installation and configuration process.

1. Log in to our client area and download the module.
DC 1.png
2. In the downloaded file you might find one or two packages that support different PHP versions.

In the most recent versions of the module, you will find only one package that supports PHP 7.2 and later.

PHP72 74.png
Previous updates of the module may contain two packages dedicated to various PHP versions.

The first one that supports PHP 5.6 up to PHP 7.1, and the second one addressed to PHP 7.2 up to PHP 7.4.
Note: Keep in mind that PHP versions 5.6 up to 7.1 are no longer officially supported and their security issues are not fixed or released any more. Find more info here.

PHP56 74.png
Note: You can check the current PHP version in your WHMCS. To do so, proceed to 'Utilities' → 'System' → 'PHP Info'.
3. Extract the package and upload its content into the main WHMCS directory.

The content of the package to upload should look like this.

DC 2 2.png
4. When you install Discount Center For WHMCS for the first time you have to rename the 'license_RENAME.php' file.

This file is located in 'modules/addons/discount_center/license_RENAME.php'. Rename it from 'license_RENAME.php' to 'license.php'.

DC 3.png
5. In order to configure your license key, you have to edit the previously renamed 'license.php' file.

Enter your license key between quotation marks as presented on the following screen. You can find your license key in our client area → 'My Products'.

DC 4.png
6. Now you have to activate the module in your WHMCS system.

Log in to your WHMCS admin area. Go to 'System Settings' 'Addon Modules'. Afterward, find 'Discount Center' and press the 'Activate' button.

DC 5.png
7. In the next step you need to permit access to this module.

To do so, click on the 'Configure' button, check required group of administrators and press 'Save Changes'.

DC 6.png
8. You have just successfully installed Discount Center For WHMCS!

You can access your module under 'Addons' 'Discount Center'.

DC 7.png

Configuration and Management

Discount Center For WHMCS has been created to help you vary your offer with personalized discounts that can be applied to chosen products and/or clients.
Configure advanced activation rules to make your offer the most attractive and competitive.

Configure Discounts

In order to configure your module properly, proceed to 'Addons' 'Discount Center' and start with setting up rules to offer attractive prices to your clients.

Standard Discounts

To start, move to the 'Discounts' section. There, press the 'Add New' button.
DC1 9.png
You are moved to the 'General' information page of the currently composed discount. Here you have to fill out the form to configure the rule.

Select the box to enable the discount, it will be put into practice immediately on creation. You may also configure this option under 'Settings'.
Name the discount and, the most importantly, declare promotional and required products.

DC1 10.png
'Apply Promotion To' - there can be products from your offer, addons and domains. According to a specified rule, pointed here items' price will be adequately changed.

Note: You must select at least one promotional product to be allowed to move to the next step.

DC1 11.png
Below, you can specify a list of 'Products Required In Cart' that a client must also have in the cart to be entitled to get the discount for promotional products.
Among them, there can be again products, addons and domains. In case a client does not have all of the required products in the cart, the discount won't be applied.
Surely, you may leave these parts blank if you do not demand any other products to be purchased at the time.

Additionally, you may add any items into 'Required Active Products' - a client must already own and have them active. Only then the discount can be applied.
All of the chosen here products are required. Please note that only active products are taken into consideration.
Press 'Next' to continue.

DC1 12.png

Product Discounts

Under 'Product Discounts' you have to set up discount rates for every product's pricing. To do so press the plus button as marked on the screen.
DC1 13.png
Enter the discount value and select its type.
It can be either percentage that will be counted from the price or a fixed amount by which the final price and/or setup fee will be reduced.
In case you are using more than one currency, you may quickly copy the rule to all available currencies to save the time.

Press 'Next' when ready.

DC1 14.png

Activation Rules

Finally, you are moved to activation rules. Here you may decide which of your clients should be entitled to purchase products with a discount.
You may grant it to:
  • All - all of your clients and guests
  • Offer it to new clients only. Move to 'Addons' → 'Discount Center' → 'Settings' to define which of your clients shall be considered 'new'.
  • Chosen clients only: enumerate specific clients or enter clients group name. All clients from this group will be given a discount.

Recurring Discounts - enable discount for recurring orders. If you do not select this option, then discount will be applied only once with the first payment.
If this option is enabled, you also have to define the number of months that the discount will be applied to the invoice. You can also provide 0 value for lifetime discount.

Finally, you may define the Validity Period.
If selected, you have to point the starting and ending date of the promotion. This option is especially helpful when setting up sales like Cyber Monday or Black Friday.
It is usually clearly stated how long such sale shall last.

Press 'Save Changes' to confirm creation of the new discount.

DC1 15.png
All available discounts are now visible, with their name, status and number of assigned products/domains/addons.
You may always change the status to disabled/enabled, check starting and ending dates of the promotion and edit the discount or delete it.
Use action buttons to do so.
DC1 8.png

Quantity Discounts

'Quantity Discounts' - offer different price depending on the number of products added into the cart. Press 'Add New' to begin.
DC1 16.png
In the 'General' section you have to name a new discount rule, enable (if you want to apply it immediately on its creation) and select required client products.
  • Specified Products In Cart - select products/domains/addons which you expect to be in the cart.
    The sum of these items is compared with the set up later on thresholds to apply an adequate discount.

Please note that items added into these fields are required.

  • Required Active Products - the discount can be applied only if a client already owns pointed here items.
    Please note that the products must be active!

Please note that items added into these fields are required.

DC1 17.png
Under 'Quantity Discount' you have to decide when the discount will be applicable.
  • If Price Is Higher Than - declare a price limit and only more expensive of the products than the limit here will be charged with the discount
  • If Price Is Lower Than - declare a maximum price limit and only cheaper products than the limit declared here will be charged with the discount
DC1 18.png
  • Promotional Products - list items that the discount can be applied to (products/addons/domains)
DC1 18 1.png
  • All Specified Products - every product that is on the list of specified (see previous point) will be charged with the discount
In this section you also have to set up 'Thresholds'.
These are the minimum numbers of products, that must fulfill the above application rule, and that must be in the cart of a single order.
Specify a percentage discount for the threshold, you can set up more than one. Press the '+' button to add more possibilities.
DC1 19.png
  • Active Services Quantity - the discount takes account of the total number of ordered products and active services already owned by a client.
    The services have to be added in the 'Specified Products In Cart' section. The 'Active Services Quantity' discount may apply to:
    • the existing services of a recurring type - to its next billing cycle,
    • the newly ordered services - to the first and subsequent invoices (if applicable).

In 'Thresholds' you set up the minimum number of client's active services which, together with products included in a new order, are taken into account by this application type.
Specify a percentage value for each discount threshold, you can set up as many of them as you need by pressing the '+' button.

For example:

  • The administrator sets a 10% discount valid when a number of active products amounts to 5. When a client who already owns 3 active services puts in a new order,
    only 2 additional products need to be added to the cart to activate this discount.

In case there are multiple discount levels configured, the module will adjust the discount to the highest tier possible. For instance:

  • The administrator formulates two rules: a 10% discount available when a number of active products amounts to 5 and a 15% discount valid if a quantity of active services equals 8.
    When a client owns 3 active services and purchases 5 new products, the module will switch the discount from 10% to 15%.

What is more, if any of active services is terminated and a current number of active services is lower than the one set for the discount, the module removes the discount from all active products.
However, if there are multiple discount thresholds configured, then the module will downgrade the discount applied to the lower tier.

The process of increasing and decreasing of the discount levels also apply to unpaid invoices.
If the customer has an unpaid invoice and the amount of active services has changed in the meantime, the amount on unpaid invoice will also be updated accordingly.

When ready, press 'Next' to continue.

DC1 19 2.png
Finally, you are moved to 'Activation Rules'.

Here, you may decide which of your clients the discount should be entitled to purchase products with a discount.
You may grant it to all of your clients and guests, offer it to new clients only or manually select desired usernames.
It is also possible to enter client groups names here and offer discounts to bundles of clients.
Other options:

  • 'Recurring Discounts' - discount is applied to following payments as well
  • 'Multiple Quantity' - apply the discount to more than one product
  • 'Promotion Code' - decide if you want to disable the discount if a promotion code is used
  • 'Validity Period' - set up time frames
  • 'Bundle' - toggle to disable the discount if product bundles are used

You can read more about these options and their functions here
Press 'Save Changes' to confirm creation of the new discount.

DC1 20.png
All available quantity discounts are now visible, with their name and status. You may always change the status to disabled/enabled, edit the discount or delete it.
Use action buttons marked on the screen below to do so.
DC1 21.png

Early Payment Discounts

'Early Payment Discounts' option allows creating and applying discounts to selected services when they are paid within defined time range.

All you need to do is specify the number of days that the discount will be active since the invoice has been created.
Look below to see how to configure such a discount exactly.

DC1 21 1.png
First of all, like in case of 'Discounts' and 'Quantity Discount' decide whether to enable it on creation and enter the early discount name.

Next, you must enter a number of days that the early discount will remain active since the moment the invoice has been created. This is an obligatory field.
Underneath, there are 'Products', 'Addons' and 'Domains' fields - select which of the services will allow early payments with the discount.
Note: Only recurring services are supported and allowed to choose.

DC1 21 2.png
In 'Product Discounts' tab you can define the discount fixed amount or percentage for selected payments and currencies.
DC1 21 3.png
'Email Notifications' - set up reminders for clients to assure they are aware of the early payment benefits.
DC1 21 4.png
Early Discount Notification - select the email templates from available that will be sent to clients when the invoice has been created.
The other notification is sent on the day the discount expires.
DC1 21 6.png
Early Discount Cancellation Reminders - select an email template that will be sent to clients just to remind about the early payment discount.
Define the number of days before the cancellation date - it will be sent that day. You may specify here more than just one day.

Remember to save the changes when the early payment discount configuration is ready.

DC1 21 5.png
The just added Early Payment Discount is now visible on the list. As in case of other discounts types, you may enable/disable it any moment, edit and delete.
DC1 21 7.png
View of the discounted items on an invoice. Please note that the early payment discounts are presented with separate minus values.
DC1 21 7 1.png

Email Templates

There are three prepared custom email templates with basic information on the discounts:
  • Discount Center - Early Payment Discount Created
  • Discount Center - Early Payment Discount Canceled
  • Discount Center - Early Payment Discount Notification

They are included in the module, once you install or update the module, they will appear in the System Settings → Email Templates → Invoice Messages section.

DC1 21 8.png
Open an email template to see information included in the message.
DC1 21 9.png
You may edit the message, list of supported be the module merge fields:

{$client_name} {$signature}

{$invoice_num} {$invoice_date_created} {$invoice_date_due {$invoice_total} {$invoice_balance} {$invoice_html_contents} {$invoice_link}

{$} {$earlyPayment.due_date} {$earlyPayment.period}

This is how an exemplary notification sent to a client may look like.
DC1 21 0.png

Additional Options


Under the 'Settings' tab you must define a few useful options.
  • New Client Status - Number Of Days - set up the number of days a client will be considered 'New'.

Such information is necessary when you select 'New - give promotion to new clients only' option as 'Activation Rule' for any of your set up discounts.
If you enter for example 14, then, if this option is selected for any of the discounts, clients with accounts not older than 14 days can have the discount applied.
Note that providing 0 value will make discount applicable only for unregistered clients.

  • Hide Guide here if you are already familiar with its content or unselect to read it again.
  • Autoapply Discounts - if checked, all newly created discounts will be enabled. You may change the status of a single discount manually.
  • Order Form - define an order form if you are using a custom one.
  • Order Note - decide if information about discounts should be saved in order note.
DC 19.png

Integration Code

There are two available variables that can be inserted into the order form template.
These are:
  1. {$dc_product_price} - Variable that allows a full product price to be displayed
  2. {$dc_product_discount_price} - Variable displaying a discount product price.
  3. {$dc_product_setup_price} - Variable displaying a full setup price.
  4. {$dc_product_setup_discount_price} - Variable displaying a discount setup price.
  5. {$dc_addon_prices[$]} - Variable that allows a full addon price to be visible
  6. {$dc_total_discount_price} - Variable displaying total discount product price.

Open the order form you are currently using, for example 'Modern', find 'ordersummary.tpl' file and enter the above variables as shown below:

<tr><td>{$}</td><td class="text-right"> VARIABLE ONE {$producttotals.pricing.baseprice}</td></tr>
<tr><td>+ {$}</td><td class="text-right"> VARIABLE FIVE </span>{/if} {$addon.recurring}</td></tr>

Please note that the below screen is just an example of variable usage, you may simply enter pure variable without any styles or change them according to your needs.
Be careful when you change the code snippets. If you are not sure how to change it, then consult it firstly with a professional.

DC1 23.png
If entered correctly, your order summary will include the discounts applied, with the new price counted and the final price visible in the order summary.
DC 24.png


In the 'Logs' tab there are enumerated information on any orders that discounts were applied, such as: invoice number, discount ID and value.
DC 20.png
Clear all the entries or delete only some of them. Use buttons marked on the screen above.


On the dashboard you can find 'Summary' table with detailed statistics on applied discounts with the most frequently used ones and the highest amount granted.
Next to 'Summary' table, a chart can be found with number of discounts applied per specified period of time. You can display the chart per week, month or a year.
DC 21.png


The very last tab 'Documentation' once clicked will redirect you to the article you are currently reading!


1. If a client adds to the cart a product that can have more than one discount applied, then a higher discount is applied on the invoice.
2. If the 'Active Services Quantity' discount is used and statuses of services are switched manually without using 'Terminate' functionality (this action may be performed either manually or automatically by the system),
the module will not take that action into account and thus will not remove the discount.
3. Discount Center module supports the WHMCS "Monthly Pricing Breakedown" option which allows showing discounts for quarterly, semi-annual, annual, and biennial prices in the equivalent monthly price.
You can read more about this option here.

Update Instructions

Essential guidance through the process of updating the module is offered here.

Keep in mind there is a quick and easy option in our client area that will let you upgrade the license of your module to an open source version at any time - and at a lower price!
To take advantage of it, simply use the License Upgrade button located on the product's page and a discounted invoice will be generated automatically.

Common Problems

1. When you have problems with connection, check whether your SELinux or firewall does not block ports.
2. The module is currently not compatible with Multibrand For WHMCS or with Resellers Center For WHMCS functionality. Do not use these modules together.
WHMCS Modules
WHMCS Translations
cPanel Modules
Magento Extensions
Magento Themes
PrestaShop Modules
Blesta Extensions
Discount Center For WHMCS