Opencart's execution of timing tasks is actually the same as ordinary tasks. We only need to encapsulate the tasks that need to be executed, and then execute them:
First, we add tasks to the oconsole file in the root directory:
Then create the task classes we need to perform under the system/console directory of the root directory:
For example, what I wrote is to get some basic information about the product. After saving the file, we can perform the task:
php oconsole list can view the current help and tasks:
Then this can be put into crontab to execute!