Setting Up Cron Job – WooCommerce Product Import Export Plugin
The Best Product Import Export Plugin for WooCommerce
#1 in WordPress Official Plugin Repository With 70,000+ Active Installs
#1 in Customer Satisfaction With Most 5 Star Reviews
WebToffee Guarantee: Get Your Money Back if You Are Not Satisfied With The Product
Buy Now!WooCommerce Product Import and Export plugin facilitates to schedule the Import and Export of the products. You can auto-import the products at regular intervals from CSV which is present on the FTP Server by providing starting time and intervals between import. You can also auto-export the products to FTP in a CSV file at regular intervals.
What is Cron?
The software utility Cron is a time-based job scheduler in Unix-like computer operating system. Generally, it is used to set up and maintain software environments to schedule jobs (commands or shell script) to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration—though its general-purpose nature makes it useful for things like downloading files from the Internet and downloading emails at regular intervals.
Cron is most suitable for scheduling repetitive tasks. Scheduling one-time tasks are often more easily accomplished using this utility.
You can run the Cron only when the site is visited in the scheduled interval. For more information, please refer to Setting Up the Cron Job article.
Setting Up Cron for Importing
The plugin automatically imports the products to your online store at the scheduled time with the specified time interval. You can also use the mapping file in which you have saved field mapping data.
Important: You must import a product from FTP manually at least once before automating it using Cron.
How to Import the products using the FTP Server?
Suppose, CSV file is as shown below:
And the uploaded CSV file on the FTP server (you can use FileZilla) is as shown below:
Note: Click sample CSV of Cron to download it.
- Navigate to Admin settings (WooCommerce > Product Im-Ex) of Plugin. Under the Product tab, the Import window appears as shown below:
- Provide FTP Details. If your CSV file is on a server, then to import it, you need to do FTP settings as given below:
- Select the checkbox to enable FTP import/export.
- Enter FTP Server Host/IP.
- Enter FTP User Name.
- Enter FTP Password.
- Enter FTP Server Path.
- Select the checkbox to use FTPS.
- You get the mapping file option(s) for auto-mapping only if you save the mapped fields with a user-defined file name while Mapping the fields. Select the required mapping file from the Select a mapping file drop-down list as shown below:
Note: If you are importing the products for the very first time, then there will be no option available under Select a mapping file. The options will be available only when you save the mapping field data in a file.
- Update products if exists: Check this check-box to update the existing products on your store with information from the CSV file. Existing products are identified by their SKUs.
- Skip New Products: While updating existing products, tick this check-box to skip products that are not already present in the store. If a new SKU is encountered in the imported CSV file, it will be skipped, and only the existing products will be updated.
- Enter the delimiter which separates the mapping values.
- Select the checkbox to merge empty cells.
- Click Upload file and Import. The import window appears as shown below:
8. Click Submit.
9. According to the CSV file, the product gets added to your online store. The import window appears as shown below:
10. The Product gets imported as shown below:
How to Automate Product Import?
To automate the product Import, navigate to Dashboard > WooCommerce > Product Im-Ex > Settings. The window is displayed as shown below:
- Select the checkbox to enable FTP import/export.
- Enter FTP Server Host/IP.
- Enter FTP User Name.
- Enter FTP Password.
- Select the Use FTPS checkbox to connect securely.
- Test FTP if working properly.
- Enter the Export Path to where the CSV file will be imported
- Enter the name of the CSV file in Export Filename.
- Choose Enabled option to automatically Import products from FTP Server Host/IP, as shown below:
- Enter the complete path of the CSV file to be imported in the Import File column
- Enter the required Start time for importing the products.
- Enter the time interval in minutes for importing the products.
- Select Merge Products if exist checkbox to merge existing product with the updated details of the same product. The Merging of the product is possible only if the product ID already exists in your online store. Otherwise, the product is imported as a new product.
- Skip new product: If a new product SKU is encountered in the imported CSV file, it will be skipped, and only the existing products will be updated.
- Delete existing products: check to delete existing products that are not present in the CSV.
- Use SKU to link grouped products: Check this to link grouped products using product SKUs instead of product IDs
- Select a required mapping file from the given drop-down list.
- Click Save Settings to save/update settings.
You can see the auto-imported products from the FTP server to your online store.
Setting Up Cron for Exporting
Auto Export the products from your online store at the scheduled time with the specified time interval.
How to Export the products to the FTP Server?
Suppose, the Product page is as shown below:
- Navigate to Admin settings (WooCommerce > Product Im-Ex) of the plugin. Under the Product tab, the Export window is displayed as shown below:
- Offset: Enter the product row number at which you wish to start the export.
- Limit: Enter the number of products that you wish to export from the Offset number.
- Product Categories: This allows you to select categories of products to be exported. This option can be used as a filter for exporting products of certain categories.
- Product types: This allows you to select the types of products to be exported. You can import simple, variable, grouped, or external products only or any combinations of these types.
- Sort Columns: Enter the column name(s) by which you want to sort the products in a CSV file. If you want to sort the products by more than one column name, enter Comma (‘,’) in between the column names.
- Delimiter: With this field, you can change the comma-separated file to ‘|’ or ‘.” separated file according to your requirement.
- Columns: Select the checkbox for required columns if you want to export specific columns. With the Column Name field, you can modify the column header in the CSV file. To do that, simply enter the required column name for the specific column.
- Include hidden metadata: Select the checkbox if you want to show hidden metadata of your products in the CSV file. To get thumbnail IDs of the product images, select this checkbox.
- Click Export Products, the CSV file gets auto-downloaded to your computer. The sample products CSV file is as shown below:
The CSV file gets exported to the FTP root folder on the server(You can use FileZilla) and it is as shown below:
Note: You can download the Sample Exported CSV.
How to Automate Product Export?
To automate the product export, navigate to Dashboard > WooCommerce > Product Im-Ex > Settings. The window appears as shown below:
- Select the checkbox to enable FTP import/export.
- Enter FTP Server Host/IP.
- Enter FTP User Name.
- Enter FTP Password.
- Select the Use FTPS checkbox to connect securely.
- Choose Enabled option to automatically Export products to FTP Server Host/IP, as shown below:
- Convert Shortcodes to HTML – Enable this check box to convert shortcodes to HTML in the CSV.
- Product Categories – This field allows you to enter the categories of the products only which will be exported.
- Export Start Time – Enter the start time for export. You can enter a time value like 10:10 am.
- Export Interval [Minutes] – Enter the time interval in minutes for exporting the products.
- Include hidden metadata – Check this box to include hidden metadata in the CSV file.
- Click Save Settings to save/update settings.
You can see the auto-exported CSV file of product details on the FTP server.
To know more about other features of the plugin, read the documentation.
The Best Product Import Export Plugin for WooCommerce
#1 in WordPress Official Plugin Repository With 70,000+ Active Installs
#1 in Customer Satisfaction With Most 5 Star Reviews
WebToffee Guarantee: Get Your Money Back if You Are Not Satisfied With The Product
Buy Now!
Comments (37)
Anto
March 2, 2021
Hi, friends.
I’m really interested in buy this plugin, but I have a pre-sale question: ¿do is possible to apply mapping settings in automatized exports? I see that option at Automatized Import, but not on importing.
Thanks.
Mark
March 2, 2021
Hi,
Yes, you can select the export mapping profile in the automatic export settings.
Anto
March 2, 2021
Thanks, Mark. My original message should have said “I see that option at Automatized Import, but not on EXporting.”
Sorry, regards.
Jonas
December 19, 2020
For me the cron job FTP option “Import From Folder” doesn’t work. Just the option “Import File” with path to the csv file. How would a folder path look like?
/folder/subfolder
folder/subfolder/
/folder/subfolder/
There is no example in your documentation. Any other reasons for not working (web hosting setup, etc?)
Mark
December 22, 2020
Hi,
Please share the FTP details from which you are importing the files via support so that we can check it.
AJ
December 22, 2020
I’m having the same problem. Using ftp with a specific file works fine but trying to import all files that are in a directory doesn’t work.
Please let me know if you have already more info.
Mark
December 29, 2020
Hi,
Could you please reach us via support.
Charles Daniels
October 6, 2020
Is there a way to automatically add the date to the filename when exporting to a server? Example ACME-{mm-dd-yy} so that the filename would be ACME-10-05-20? Is this possible? Thanks
Alan
October 6, 2020
Hi,
We can provide you with a snippet to do it. Please reach us via support.
Craig
July 28, 2020
Is it possible to set a scheduled import from a url at, say, 1 hours invervals? I see this question has been asked in the comments and the answer is yes, but there is nothing on the videos or in the support documentation that confirms or shows how this is achieved – everything relates to the scheduled FTP import, but I need to be able to do it from a URL. I know you offer a refund, but I’d rather confirm in advance that this will work before purchasing. If you could clarify that would be appreciated!
Alan
July 29, 2020
Hi,
Yes, using the plugin you can schedule import from URL at an interval of 1 hour. In the URL import settings, you may please specify the import start time and import interval as 60 in order to run the import every hour.
Scott Donald
June 15, 2020
Hi,
Can I set a URL that I can call to do run the import instead of doing it automatically? i.e. I want to run it only when I want to.
Alan
July 8, 2020
Hi,
By default, there is no option to set a URL to run the cron import when needed instead of running it automatically.
Gertrude
April 22, 2020
Great post.
frits.erasmus
November 1, 2019
I am selling fresh products for doorstep delivery.
Certain products are only available for purchase on certain days of the week.
My plan is to create two files “Available” = file 1 & Un-Available” = file 2 using the visible switch to control what customers can see to buy.
So having two files that will, in turn, be loaded on Monday Morning file 1 and file 2 on Tuesday night and then file 1 on Thursday morning and file 2 Friday evening.
How would I accomplish this?
Alan
November 2, 2019
Hi,
Yes, you can schedule the import on desired days by providing the details of the FTP in which the CSV files are present. You may please provide the FTP details, import start time, and the import interval time in the plugin settings so that the import will run at a specific time automatically.
Currently, there is no option to scheduled import two CSV files at different intervals of time from the FTP. You will have to change the file name/path each time for the CSV files to import. Or else you can schedule one import using the FTP import method and other with the URL method.
For better understanding, you can go through the documentation on how to set up cron import process using the plugin. If you still have any more queries regarding scheduling the import please reach us via support.
Ian
October 4, 2019
I have this integrated in a website and it works if update the feed manually but the automation don’t seem to be working even though the automatic product import is checked for the feed. I don’t know enough about wordpress or the plugin to see what the issue is, can anyone help please?
Alan
October 5, 2019
Hi,
Kindly make sure that you have provided the correct FTP details, import start time, interval time, and the CSV file path including the file name in the scheduled import settings of the plugin. If the issue still persists please reach us via support.
Ian Haney
June 22, 2020
Hi. I am still having this issue, the FTP info, import start time, interval time, and CSV file path and file name is correct. The file name is just the name of the file as it’s in the root on the FTP server. I have just contacted you via the support link
katy
September 17, 2019
Hello,
Can i set a automatic update for URL import? Just want to update my stock every day using cron job .
Thank you.
Alan
September 17, 2019
Hi,
Yes, you can schedule an automatic update of products using the URL import method to update the stock quantity on a daily basis.
Jacob
August 20, 2019
Hi,
Is it possible to make a cron job, where the quantity will be updated from sold products..
Like; If there is 10 in stock, and we upload a .csv with -1, there will be 9 in stock.
Alan
August 21, 2019
Hi,
Yes, you can manage the stock quantity of the products by scheduling the import. If you are required to reduce the stock amount of a product from 10 to 9 then you may please provide the data (-)1 in the stock column.
Laurens
August 1, 2019
Can I export all my sold items to my supplier automatically or manually?
Alan
August 2, 2019
Hi,
By default, there is no option to export only the sold-out items automatically to the FTP server. We can provide you with a custom code snippet for the premium version of the plugin to export only the sold-out items automatically to the FTP.
Please reach us via support if you are interested in having the code snippet.
Bäthge Maximilian
July 4, 2019
Hello,
can i set a automatic update for URL import? Just want to update my stock every 15 minutes.
Alan
July 4, 2019
Hi,
Yes, you can schedule automatic import/update via URL import to update the stock of products at a specific interval of time.
Bäthge Maximilian
July 4, 2019
Can u describe me how?
I have imported everything now and it works fine. But i can’t find the Option for the automatic update, may u have a tutorial for me?
Thanks.
gchisholm
June 15, 2019
What should the time interval in minutes for importing the products be set to or based on?
Mark
June 16, 2019
It depends on your requirement. ie how frequent you need to update the data. Say for eg, if you need to update it once per day set 1440 minutes as the interval.
Luis
January 14, 2019
Where i can see the debug log? is active by default the DEBUg log of the cron processs?
Alan
January 14, 2019
Hi Luis,
You can find the cron import log from Woocommerce>Status>Logs>csv-import.
carlos
November 23, 2018
Hi, I am interested in the pro-version of your product
Yesterday night I find a “sandbox” to test, but now I cannto find….
Please, can you send me the url for test ??
Thanks
Carlos
Mark
November 26, 2018
Hi,
Currently, there are no demo servers to test the plugin due to some server issues.
You may go ahead and purchase the plugin. We offer 30 days-No Questions Asked-100% refund guarantee for our plugin purchase.
Luis
March 22, 2018
is there some logs if the cron fails or is ok?
James
December 7, 2016
Where can I find this Cron plugin?
Ando
December 7, 2016
Hi James,
We have a product import export plugin which has cron job feature in it.
kindly find the link to it – https://www.xadapter.com/product/product-import-export-plugin-for-woocommerce/