Cron

cron

The “Cron” function is the function that makes possible integrating wizAffiliates with any extension without making any change in that extension. It is taking all the orders defined in the parameters of the commission sources and generates commissions for them and makes the payment request in case the total amount of the commissions of an affiliate is higher then the minimum amount set in the parameter “Minimum commission amount” of the control panel of wizAffiliates, “Commissions” tab.

Improper setup can add a very high load on the server or even run scripts that time-out and generate problems.

You can have it run in two ways:

a) when visitors are opening the pages of the site

b) through a direct link with a repetitive task set in your hosting account

No matter which one you chose make sure “Allow cron in front-end” is set to “Yes” if you don't want to run “Cron” only from the back-end.

The recommended one is the second one. It will not affect the visitors of the site, can be better controlled, will load only the resources required by it so there are less chances to have a time-out or overload the server.

But will describe how to setup both of them.

a) When visitors are opening the pages of the site

For this to work you have to make sure you have installed and activated the wizAffiliatesCron plugin. This is done in the control panel of wizAffiliates, “Integration” tab. The line mentioning it has to contain only a green text saying the plugin is installed and a button that allows you to uninstall it.

If you have a red text there the plugin is installed but not activated and you need to access the plugin manager in Joomla! ( in the administrator page, top menu, “Extensions”, “Plug-in Manager” ) and activate it.

If there is no gree text saying the plugin is installed you need to install it ( press the “Install” button on the same line ).

An important step is to make sure you uninstalled all the commission sources that you are not using and properly set the parameters of the ones you are using. Depending on the number of visitors of the site set the parameter “Days to check orders” to something different the 0. Recommended setting is 1 or 2, but this is only in case you have at least one visitor each day on your site.

Set the value of “Orders to check” to 0.

Another important parameter is “Run wizAffiliatesCron” from the control panel of wizAffiliates, “Cron” tab. The recommended setting is “Once / session” but if you don't have a big site you can set it to “Once / minutes” and set the minutes to something like 10 minutes or even set it to “On all pages”. In this last 2 situations is better to deactivate the checking of the orders by date ( set “Days to check orders” in the commission sources to 0 ) and use the “Orders to check” parameter. Set it to a value that you estimate the number of orders in the specified period. On a small site setting it to 2 should be fine.

b) Through a direct link with a repetitive task set in your hosting account

As I said this is the recommended way.

Make sure wizAffiliatesCron plugin is uninstalled ( in the control panel of wizAffiliates, “Integration” tab ).

Set “Run wizAffiliatesCron” to “Never” ( in the control panel of wizAffiliates, “Cron” tab ).

Uninstall all the commission sources you're not using ( in the control panel of wizAffiliates, “Commission sources” tab ).

Set the parameter “Days to check orders” to 1 and “Orders to check” to 0 on all used commission sources.

Get the value of “URL to run cron in front-end” from the control panel of wizAffiliates, “Cron” tab and set a repetitive task on your hosting account. For example to set this kind of task in a cPanel hosting account you can find more information here : http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/CronJobs.

You should set this repetitive task to be executed at least once a day. The more often is executed the sooner the commissions are generated and the affiliates are notified about them.