The Cancellation Manager offers you the possibility to provide your WHMCS products with contract periods and notice periods. The next 5 possible cancellation dates are displayed to the client when a cancellation is made.
System requirements
To use and install the Cancellation Manager module, the following requirements must be met:
- Executable WHMCS installation version 8.8 – 8.11
- Admin access to WHMCS
- FTP access
- installed Ioncube Loader (at least version 13)
- PHP 7.4, 8.1, 8.2
Installation
- Please log into the customer area of Plambee.de Webhosting and download the current version of the Cancellation Manager.
- Unzip the file on your computer.
- upload the folders modules and templates via FTP into your WHMCS directory.
- Now log in to your WHMCS admin area.
- In the addon list please look for the module “Cancellation Manager” and click on “Activate” and then on “Configure”.
- In the field “Module license” please enter your license code, you can find it in the Plambee.de customer area in the product details.
- In the field “Admin Reminder Days” you can specify how many days before the cancellation the admin should receive a reminder, if the option below is activated accordingly.
- In the field “Client Reminder Days” you can specify how many days before the cancellation the client should receive a reminder, provided the option below is activated accordingly.
- With the option “Use Default Terms” you can activate the default values defined below. These default values are then used for products for which no separate configuration has been created via the module.
- “Default Notice Time”, please enter the notice period in days here.
- “Default Contract Time”, please enter the contract period in months here.
- Be sure to deactivate the WHMCS notice system in the Automation Settings.
Once the module has been installed, you can go to the module and enter the respective deadlines for your products. Once you have stored the deadlines, you will need to make a few template adjustments if you are not using the template files supplied.
Template adaptations
The module package already contains files adapted for the six template, but if you use your own template or if the corresponding TPL files are already modified by you, you must adapt your template files manually. The description is based on the six template from WHMCS, the required adaptations may differ for other templates. If you are unable to make the corresponding adaptations yourself, please contact our support for a quotation.
clientareaproductdetails.tpl
Replace:
<a href="clientarea.php?action=cancel&id={$id}" class="btn btn-block btn-danger {if $pendingcancellation}disabled{/if}">{if $pendingcancellation}{$LANG.cancellationrequested}{else}{$LANG.clientareacancelrequestbutton}{/if}</a>
with
<a href="clientarea.php?action=cancel&id={$id}" class="btn btn-block btn-danger">{$LANG.clientareacancelrequestbutton}</a>
otherwise, the customer will no longer be able to access the cancellation page in order to cancel a cancellation if the cancellation is stored.
If you want to show the customer in the product details when the product was cancelled, open the clientareaproductdetails.tpl in an editor and add the following in a suitable place:
{if $cancellation_manager_canceldate}
<h4><strong>{$canceled_to} {$cancellation_manager_canceldate}</strong></h4>
{/if}
Due to the IF query, the note is only displayed if there is also a cancellation for the product.
If you also want to display the contract term and the notice periods, you can do this, for example, with the following code
{if $cm_notice_time}
<h4>{$cm_notice_time_lang} {$cm_notice_time}</h4>
{/if}
{if $cm_contracttime}
<h4>{$cm_contracttime_lang} {$cm_contracttime}</h4>
{/if}
clientareadomaindetails.tpl
If you want to enable the customer to cancel domains according to contract periods and deadlines (i.e. deactivate the automatic renewal), the clientareadomaindetails.tpl must be adapted.
To do this, replace the div block tabAutorenew
<div class=”tab-pane fade” id=”tabAutorenew”>
…..
…..
…..
</div>
<div class=”tab-pane fade” id=”tabNameservers”>
with
<div class=”tab-pane fade” id=”tabAutorenew”>
{if $cm_domain_canceled != ‘1’}
{include file=”$template/includes/alert.tpl” type=”success” msg=$cm_domain_text textcenter=true}
<form role=”form” method=”post” action=”” id=”form” class=”form-stacked”>
<fieldset>
<div class=”form-group”>
<label for=”cancellationreason”>{$LANG.clientareacancelreason}</label>
<textarea name=”cancellationreason” id=”cancellationreason” class=”form-control fullwidth” rows=”6″></textarea>
</div>
<div class=”form-group”>
<div class=”form-group”>
<div class=”form-inline text-center”>
<label class=”control-label” for=”type”>{$cm_lang_cancellation_date}</label>
<select name=”date” class=”form-control”>
{foreach from=$cm_domain_cancel_dates item=date}
<option value={$date.systemdate}>{$date.clientdate}</option>
{/foreach}
</select>
</div>
</div>
</div>
<div class=”form-group”>
<div class=”form-inline text-center”>
<input class=”btn btn-danger” type=”submit” name=”cm_cancel_domain” value=”{$LANG.clientareacancelrequestbutton}”>
</div>
</div>
</fieldset>
</form>
{else}
{if $cm_can_remove_domain_cancel eq ‘1’}
{include file=”$template/includes/alert.tpl” type=”error” msg=$cm_domain_canceled_text textcenter=true}
<form role=”form” method=”post” action=”” id=”form” class=”form-stacked”>
<div class=”form-group”>
<div class=”form-inline text-center”>
<input class=”btn btn-danger” type=”submit” name=”cm_remove_domain_cancel” value=”{$cm_remove_cancellation}”>
</div>
</div>
</form>
{else}
{include file=”$template/includes/alert.tpl” type=”error” msg=$cm_domain_canceled_text2 textcenter=true}
{/if}
{/if}
</div>
<div class=”tab-pane fade” id=”tabNameservers”>
clientareacancelrequest.tpl
The adjustment of the clientareacancelrequest.tpl is necessary so that the cancellation times are displayed to the client and so that the cancellation arrives at the module. Without this adjustment the cancellation will end up in the WHMCS own cancellation system and the product can be cancelled at the wrong time if the WHMCS own cancellation system is not deactivated.
Replace
{if $invalid}
{include file=”$template/includes/alert.tpl” type=”error” msg=$LANG.clientareacancelinvalid textcenter=true}
<p class=”text-center”>
<a href=”clientarea.php?action=productdetails&id={$id}” class=”btn btn-primary”>{$LANG.clientareabacklink}</a>
</p>
{elseif $requested}
{include file=”$template/includes/alert.tpl” type=”success” msg=$LANG.clientareacancelconfirmation textcenter=true}
with
{if $cm_mod_error}
<div class=”alert alert-danger”>
{$cm_mod_error}
</div>
{elseif $requested}
{if $cm_remove_cancel == ‘1’}
{include file=”$template/includes/alert.tpl” type=”success” msg=$cm_clientareacancelconfirmation textcenter=true}
<form role=”form” method=”post” action=”” id=”form” class=”form-stacked”>
<div class=”form-group”>
<div class=”form-inline text-center”>
<input class=”btn btn-danger” type=”submit” name=”cm_remove_cancel” value=”Kündigung widerrufen”>
</div>
</div>
</form>
{else}
<div class=”alert alert-danger”>
{$cm_remove_late}
</div>
{/if}
Then please search for the line
{include file="$template/includes/alert.tpl" type="info" textcenter=true msg="{$LANG.clientareacancelproduct}: <strong>{$groupname} - {$productname}</strong>{if $domain} ({$domain}){/if}"}
and remove the underlying code and insert the following code into the file
{if $cm_cancel_dates != ''}
<form role="form" method="post" action="" id="form" class="form-stacked">
<fieldset>
<div class="form-group">
<label for="cancellationreason">{$LANG.clientareacancelreason}</label>
<textarea name="cancellationreason" id="cancellationreason" class="form-control fullwidth" rows="6"></textarea>
</div>
{if $domainid}
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">{$LANG.cancelrequestdomain}</h3>
</div>
<div class="panel-body">
<p>{$LANG.cancelrequestdomaindesc|sprintf2:$domainnextduedate:$domainprice:$domainregperiod}</p>
<div class="col-sm-12 text-center">
<label class="checkbox">
<input type="checkbox" name="canceldomain" id="canceldomain" /> {$LANG.cancelrequestdomainconfirm}
</label>
</div>
</div>
</div>
{/if}
<div class=”form-group”>
<div class=”form-group”>
<div class=”form-inline text-center”>
<label class=”control-label” for=”type”>{$cm_lang_cancellation_date}</label>
<select name=”date” class=”form-control”>
{foreach from=$cm_cancel_dates item=date}
<option value={$date.systemdate}>{$date.clientdate}</option>
{/foreach}
</select>
</div>
</div>
</div>
<div class=”form-group”>
<div class=”form-inline text-center”>
<input class=”btn btn-danger” type=”submit” name=”cm_cancel_product” value=”{$LANG.clientareacancelrequestbutton}”>
</div>
</div>
</fieldset>
</form>
{else}
<div class=”alert alert-success”>
{$cm_free_product}
</div>
{/if}
{if $cancelation_manager_hasaddon}
<br>
<table class=”table”>
<thead>
<tr>
<th>{$cm_addonname}</th>
<th>{$cm_lang_cancellation_date}</th>
<th></th>
</tr>
</thead>
<tbody>
{foreach from=$cm_addon_dates item=addon}
<form action=”” method=”post”>
<tr>
<td>{$addon.name}</td>
{if $addon.dates neq “”}
<input type=”hidden” value=”{$addon.id}” name=”addon_cancel_id” id=”addon_cancel_id”>
{if !$addon.hascancel}
<td>
<select name=”date” class=”form-control”>
{foreach from=$addon.dates item=addondate}
<option value={$addondate.systemdate}>{$addondate.clientdate}</option>
{/foreach}
</select>
</td>
<td>
<input class=”btn btn-danger” type=”submit” name=”cm_cancel_addon” value=”{$cm_cancel_addon}”>
</td>
{else}
<td>{$addon.hascancel}</td>
<td><input class=”btn btn-danger” type=”submit” name=”cm_remove_addon_cancel” value=”{$cm_remove_cancellation}”></td>
{/if}
{else}
<td>{$cm_addon_no_entries}</td>
{/if}
</tr>
</form>
{/foreach}
</tbody>
</table>
{/if}
{/if}
Use
Deposit deadlines
Save deadlines in the module
To add a deadline for a product in the module, please go to the module and click on “Deadlines” at the top and then on Add deadline.
Then select the product for which you want to add the deadline. Now you have the following setting options:
- Use config option for the contract period: Activate this option if you do not want to store the contract period directly in the module but want to use a config option for it (details below).
- Use config option for notice period: Activate this option if you do not want to store the notice period directly in the module but want to use a config option for it (details below).
- Billing interval = contract period: With this option, the minimum contract period corresponds to the billing interval. For example, if the customer has a semi-annual billing, the term is 6 months.
- Contract term in months: If you do not want to regulate the term via a ConfigOption, please enter the number of months for the contract term here. So e.g. 6
- Config option for the contract term: If you have selected the box for the ConfigOptions above, you can select the corresponding Config option here. If you have not yet created a corresponding ConfigOption, please create one.
- Notice period in days: If you do not want to regulate the notice period via a ConfigOption, please enter the number of days for the contract term here. So e.g. 14
- Config option for the notice period: If you have selected the box for the ConfigOptions above, you can select the corresponding Config Option here. If you have not yet created a corresponding ConfigOption, please create one.
- Block first: Activate this box if you want to block the products at the time of termination and do not want to terminate them.
- Cancel finally after X days: Please enter here how many days after the blocking the product should be cancelled.
- Cancellation Revoke up to X days before cancellation: Here you can enter the number of days (e.g. 4) from when the customer can no longer revoke a stored cancellation via the customer area. The entry of e.g. 4 means that the cancellation can no longer be revoked 4 days before execution.
When you have set everything, please click on Save.
Update deadlines
If you want to change an existing deadline, simply create a new one as if there were no deadline for the product. The existing deadline will then be updated when you save it
ConfigOptions
If you want to realise the deadline and/or runtime by means of ConfigOption, please proceed as follows:
- Create a new ConfigOption in a new or existing group.
- For the notice period, the option must look like this: NUMBER_OF_DAYS|your text. So e.g. 14|14 days notice period.
- For the contract period, the option must look like this: NUMBER_OF_MONTHS|Your text. So e.g. 1|1 month minimum contract period
- Assign the ConfigOptions to the product
Trial deadlines
With version 2.0.0 it is possible to store a fixed term for products, e.g. to realise test accesses. For this purpose, you can select the corresponding field when saving a deadline. For the reminder option, you can select whether the customer should receive a reminder email x days before the product expires. Several days can be entered in the corresponding field, separated by commas, e.g. 0,2,4,6 – whereby the 0, if no blocking function is used, stands for a cancellation notice.
Email templates
E-mails sent to the client and the admin can be customised via the WHMCS template system. Some of the templates are created by the module during installation or are already included in WHMCS itself; different variables are available here depending on the template.
Cancellation Request Confirmation
With WHMCS’ own termination confirmation, additional variables are available with the module:
- {$cancellation_date} = Display of the cancellation date.
- {$service_domain} = domain name
- {$report_date} = date with time when the cancellation was received
Cancellation of termination
This e-mail template is sent to the customer when the cancellation for his product has been revoked. The following variables are available here
- {$cancel_date} = the date on which the product was cancelled
- {$product} = the product for which the cancellation was revoked
- {$report_date} = Date of cancellation
- {$addon_product} = Name of the main product for an addon
- {$addon} = addon
- {$domain} = domain
Cancellation Reminder
This e-mail is used to remind the customer of the cancellation. The following variables are available here
- {$days} = number of days when the products are cancelled
- {$canceled_product} = array containing the corresponding products with service ID and cancellation date
- {$canceled_domain} = Array with cancelled domains
New Cancellation Request
This email is sent to the admin of the system when a cancellation is deposited. This is a template that comes from WHMCS. In addition to the WHMCS variables, the variable {$domain_cancelled} is also available here. This variable can contain 2 values, 0 and one. This allows you to store an If query, for example.
{if $domain_cancelled == '1'}The Domain {$domain_name} was terminated by the client{/if}
Trial Reminder
- {$product} = product
- {$days} = available runtime in days
- {$suspend} = Bool if the product has already been suspended
- {$suspend_days} = number of days the product remains in the locked state until it is deleted
Template variables
For the product details page, you can also use the variables to display the term and deadline:
- {$cm_notice_time} = notice period
- {$cm_contracttime} = Contract period
ProRata specifics
In order to also realise deadlines and contract periods for products using ProRata billing, there is a small special feature in the module. With ProRata billing, the product is always billed on a certain day of the month (often the first of the month), regardless of when the customer originally ordered it. When ordering, the customer only receives a proportional invoice, e.g. 11-30, and on the 1st of the following month he is always billed from the first to the last. Now, however, there is the problem that the contract period of, for example, 1 month, gives the customer the possibility to cancel on the 11th of a month, but since WHMCS has invoiced from the 1st to the last of the month, the customer would have to be given a credit note for the remaining days. A circumstance that again causes personnel effort and costs. In order to make this easier, the module ensures that the customer’s last invoice is only calculated on a pro rata basis, e.g. from 1 to 10. In this way, it is also possible to use contract periods correctly with ProRata without having to fear additional expense due to refunds. If the client cancels the contract, the module creates a new invoice for the remaining time of the month, e.g. 10-30, 1 day after the cancellation should have been carried out, so that WHMCS can carry out the usual billing on the first day of the next month.
New in Version 2.2.0
With version 2.2.0, the setting “Termination with Pro Rata at the end of billing” was added to the time limits. If this option is activated, the customer can terminate the contract at the end of the billing period in accordance with the minimum contract period. In this case, there is no pro rata billing of the module as described above.
Please note, however, that this may result in shifts in the “minimum contract period”. Example: You have set up your product in such a way that when an order is placed after 15 March, the next month is billed directly, so that the customer has to pay 1 1/2 months directly in the case of a new order. The customer orders your product on 15.03. and cancels it on 20. According to the contract term, the customer could actually cancel on 15.4., but if this option is active, the customer can only cancel on 01.5. (when ordering, he has already paid by 30.04.).
Note on PayPal Subscriptions
If your client has any subscription payments, please be sure to cancel them. WHMCS cancels e.g. PayPal subscription payments. PayPal subscription payments when cancelling the product itself, but there is no possibility to change the subscription payment so that PayPal only debits a pro rata amount with the last invoice. Thus, you would send the customer a proportional invoice, but receive a fully settled payment from PayPal.
New in Version 2.2.0
In version 2.2.0, the option was integrated that a deposited subscription payment is cancelled in case of cancellations. Please note that the gateway used must also support this.
Cancellations of subscription payments are made 3 weeks before the cancellation date, so that the last subscription payment can still be made successfully.
Notes
Addons
If the main product is cancelled, WHMCS will also cancel all addons to this product. Addons cannot stand alone.
Domains
Due to the different billing options for domains, the domain will be marked with the “Do-Not-Renew” flag in WHMCS only 10 months before the cancellation date. The reason for this is that there are users who bill domains over several years, but are themselves billed annually by their registrar. If the module were to set the “Do-Not_Renew” flag earlier, it could happen that the domain expires too early at the registrar, although the end of the term in WHMCS has not yet been reached.
When a domain is terminated in WHMCS (taking into account the special feature described above), the module updates the status of the domain via the WHMCS API. Whether your registration module synchronises the “Do-Not-Renew” status via the domain sync depends on your module. If your module does not synchronise, you must cancel the domain with your registrar yourself.