This service has been discontinued

If you are a company selling whmcs modules and you are interested in our code you can contact us with an offer at info at whmcstricks dot com
All other requests will be ignored.

Check for manual renewal

February 1, 2018

Sometimes you need to renew a product or service once it has been renewed by the client. For example you might have a VPS or a license that you're managing manually.

With this hook you can check if when an invoice gets paid includes a package, addon or configurable options that has to be renewed manually.

One of our clients for example is reselling VPS that he orders manually, and the cPanel license as a configurable option, thus we create this hook to make its life easier. This way the hook will create a ToDo when he has to renew a service, reducing the checking and possible errors.

Retired

This hook requires WHMCS API CreateToDo to work properly and our free Custom module to manage hooks settings.

Installing the hook

Installing the hook is easy as always. All you have to do is to upload the file in the includes/hooks directory in WHMCS.

Then you'll need to configure it using our module to make it work.

Configuring the hook

The hook has 4 settings:

  • whmcstricks_packages_that_require_manual_renewal - a list of comma separed product ids for products that needs manual renew
  • whmcstricks_addons_that_require_manual_renewal - a list of comma separed addons id for addons that needs manual renew
  • whmcstricks_configurable_options_that_require_manual_renewal_dropdown - a list of comma separed option for dropdown and quantity configurable options
  • whmcstricks_configurable_options_that_require_manual_radio_yesno - a list of comma separed option for radio and yes/no configurable options

Let's see all this settings one by one.

Setting: whmcstricks_packages_that_require_manual_renewal

To retrieve the product id all you have to do is to go to Setup -> Product/Service -> Product/Service and hover over the edit button (or click on it)

Check for manual renewal products

While you hover on it your browser will show the url. If not just click on it to see the url in the address bar. The ID of the product will be the last number in the url, right after &id=

Setting: whmcstricks_addons_that_require_manual_renewal

To retrieve the product id all you have to do is to go to Setup -> Product/Service -> Product Addons and hover over the edit button

Check for manual renewal addons

While you hover on it your browser will show the url. If not just click on it to see the url in the address bar. The ID of the product will be the last number in the url, right after &id=

Setup the module for Configurable Options

Now we come where it's harder, because of the way WHMCS manages product configurable options.

To check which configurable option type is yours, you need to go to Setup -> Product/Service -> Configurable Options then click on the option group you want to check for manual renew.

You will now see a list of configurable options available for your group. Editing one of these options will open a new window. In the top-right part of the window you'll see a dropdown with a label "Option Type". depending from the option Type you'll retrieve the option in a different way.

Setting: whmcstricks_configurable_options_that_require_manual_renewal_dropdown

We had to divide the setting depending from the type of configurable option. This setting is only valid for configurable option type Dropdown and Quantity.

Once you accessed the group you want to edit, click on the icon to edit the option you want to retrieve the id for

Check for manual renewal configurable options dropdown

This will open a new window, that will show the various options available for your clients.

In our case we want to setup the hook to create a todo when a product that has the option cPanel is renewed.

Check for manual renewal configurable options cPanel

In the screenshot above you can see that the option type is dropdown, in the red circle on the top right corner. To retrieve the ID for the "cPanel" option right click on the textbox with the cPanel name and click on inspect (we are using Google Chrome, but it can be done on other browser with little differences).

A new window will open with focus on the HTML input part of the code. you will see this:

<span class="webkit-html-attribute-name">name</span>="<span class="webkit-html-attribute-value">optionname[***]</span>"

The number included in the square brackets will be the id to use in your settings. The process is the same for the type Quantity

Setting: whmcstricks_configurable_options_that_require_manual_radio_yesno

In this case it is a bit easier. All you have to do is to select the option group, then right click on the edit button, and click on inspect

Check for manual renewal configurable options radio

On the inspector you will see a text like this one:

<a href="#" onclick="manageconfigoptions('65');return false"><img src="images/edit.gif" border="0"></a>

The number included into the brackets right after the text "onclick="manageconfigoptions"" will be the id for your configurable option.

Retired

One comment on “Check for manual renewal”