What is CRON?
If you want to use the scheduling features, your server has to support CRON functions.
The CRON daemon is a long running process that executes commands at specific dates and times. By clicking on the button Test CRON support, you can check if your server supports CRON commands. If you have other running CRON jobs and the service is enabled, you should be able to see them in the Current CRON jobs list, which is displayed in the newly opened popup.
How to set up a CRON job?
You just have to set up the settings above and click on the Save Changes button. The page will refresh and you should be able to see the CRON job under the Current CRON jobs list, which is displayed in the Test CRON support popup.
NOTE: Keep in mind that you should have at least one active mail template in order for the module to be able to send emails to your customers.
I did setup a CRON job, but it did not appear? Why?
If your server does support CRON jobs, but after you set up one it does not show up in the "Current CRON jobs" list, this means that the automatic creation of CRON commands is disabled from your hosting provider. In that case, you can use the following command string:
0 0 * /usr/local/bin/php /home/abandone/public_html/oc2/vendors/abandonedcarts/sendReminder.php
The script above will be executed every day at 00:00. You can change it depending on your preferences.
My server does not support CRON jobs. What should I do?
If your server does not support cron jobs, you can try using services such as easycron.com, setcronjob.com or others which can provide you this feature.
In order to do that, you have to register in the selected service and use this URL for execution:
- http://abandonedcarts.demo.isenselabs.com/oc2/index.php?route=module/abandonedcarts/sendReminder You should also enable the Scheduled Tasks feature above and set the Delay option in each template.
How can I setup the CRON to be executed more than once a day?
This means that you have noticed that you can currently set the CRON job to be executed only once a day. This is because in our experience, most of the customers are getting frustrated if they get an email more than once.
As you know, our templates are with a set Delay, which means that when the CRON is executing, it is checking for all orders which are matching the delay in the given template. With that said, if the CRON is executed more than once, that check will be executed also more than once, which will therefore result in sending emails more than once.
Still, if you still want to send emails more than once a day, you get around that quite easily. What you have to do is:
Set the CRON command manually in your crontab, depending on how often you want it to be executed.
Set just one email template with delay of 0 days.
This is it! You are good to go!
As you can see, you can send emails more than once a day with no coding whatsoever. The only limitation would be that you will only have just one template that you can use.
What is message delay and how should I set it up?
You should also have in mind the Delay option. Here is more info about it:
OpenCart 1.5.x - The delay option is right under the Scheduled tasks option in the tab Control Panel and it is used to calculate how old are the cart records in the module. For example: If you set the delay to be 3 days and the cron job is running every day at 00:00 AM, the customers who have abandoned cart records will receive a message on the third day of the cron job execution. It is working on the principle older than X days. This means that on the next day the customer will receive message again if the record is not removed (the customer placed an order or the record was removed by the script).
OpenCart 2.0.x. - Here it works a bit differently. The delay is separate for each mail template that you have. For example: If you have two mail templates, the first email with delay set to 3 days and the second email with delay set to 6 days, the customers will receive the first template on the third day after the abandonment and the second template on the sixth day (unless they made a purchase or the record is removed). Here the case is exactly on X day.