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.
RetiredThis hook requires WHMCS API CreateToDo to work properly and our free Custom module to manage hooks settings.
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.
The hook has 4 settings:
Let's see all this settings one by one.
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)
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=
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
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=
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.
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
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.
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
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
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
[…] the details about the configuration please refer to this article: Check for manual renewal. The names of the settings are basically the same, the only word that differs is activation (in […]