Follow

Order Feed - Cron Order Exports

This article assumes a certain level of understanding of technical concepts.

The Order Feed module can be run from the command line in an SSH session, or automatically on a Cron Task, provided your webhost allows you to use these functions. This gives you an extra step of automation over running it manually from the admin of your store. It also allows you to avoid 30 second time limits usually applied by shared webhosts' default PHP settings.

How it works

When you go through the Order Feed export setup, the settings you choose are saved. If you run the module from the command line, either by SSH or a Cron Task, these settings will be used to import your products. The Order Feed module includes a file called cron_order.php, which will be placed in the admin/ folder of your 
store. This is the entry point to the Order Feed for SSH or Cron Task. It will bypass the normal OpenCart security system, however it has its own security so that it can only be run from the command line (not through the webserver). This will prevent unwanted access.


The Cron Command

Use the following command to run the script on a Cron Task or through SSH:

php /home/opencart/admin/cron_order.php

You will need to replace /home/opencart/ with the full path to your OpenCart installation. Cron tasks should not be running concurrently as they share crucial resources.

The command  will create a file called 'order_export.csv' in your opencart/admin folder unless otherwise specified.

To generate an order feed with a different name modify the cron command to include your file at the end, like so (where the new file will be 'file_name_date' or similar):

php /home/opencart/admin/cron_order.php file_name_date

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

  • Avatar
    hasim

    hi,

    try to run this on my ssh and it give me  "restricted access" msg.  what can i do to make this works?

Powered by Zendesk