Setting Up Cron Job – WooCommerce Product Import Export Plugin

The Best Product Import Export Plugin for WooCommerce

#1 in WordPress Official Plugin Repository With 40,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 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 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:Sample CSV

And the uploaded CSV file on the FTP server (you can use FileZilla) is as shown below:

remote siteNote: Click sample CSV of Cron to download it.

  1. Navigate to Admin settings (WooCommerce > Product Im-Ex) of Plugin. Under the Product tab, the Import window appears as shown below:

Import Products set up

  1. Provide FTP Details. If your CSV file is on a server, then to import it,  you need to do FTP settings as given below:
    1. Select the checkbox to enable FTP import/export.
    2. Enter FTP Server Host/IP.
    3. Enter FTP User Name.
    4. Enter FTP Password.
    5. Enter FTP Server Path.
    6. Select the checkbox to use FTPS.
  2. 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:mapping fileNote: 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.
  3. 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.
  4. Skip New ProductsWhile updating existing products, tick this check-box to skip products which 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.
  5. Enter the delimiter which separates the mapping values.
  6. Select the checkbox to merge empty cells.
  7. Click Upload file and Import. The import window appears as shown below:

mapped fields      8. Click Submit.

9. According to the CSV file, the product gets added to your online store. The import window appears as shown below:import-successful

10. The Product gets imported as shown below:products page

How to Automate the Product Import?

To automate the product Import, navigate to Dashboard > WooCommerce > Product Im-Ex > Settings. The window is displayed as shown below:FTP-Settings-Import-Export

  • Select the checkbox to enable FTP import/export.
  • Enter FTP Server Host/IP.
  • Enter FTP User Name.
  • Enter FTP Password.
  • Select 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:AutomaticaI import
  • 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:Product page exp1

  1. Navigate to Admin settings (WooCommerce > Product Im-Ex) of the plugin. Under the Product tab, the Export window is displayed as shown below:

Product Export Screen

  1. Offset: Enter the product row number at which you wish to start the export.
  2. Limit: Enter the number of products that you wish to export from Offset number.
  3. Product Categories: Allows you to select categories of products to be exported. This option can be used as a filter for exporting products of certain categories.
  4. Product types: 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.
  5. Sort Columns: Enter the column name(s) by which you want to sort the products in CSV file. If you want to sort the products by more than one column name, enter Comma (‘,’) in between the column names.
  6. Delimiter: With this field, you can change the comma separated file to ‘|’ or ‘.” separated file according to your requirement.
  7. 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.
  8. 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.
  9. Click Export Products, the CSV file gets auto-downloaded to your computer. The sample products CSV file is as shown below:Sample CSV 2The CSV file gets exported to the FTP Root folder on the server(You can use FileZilla) and it is as shown below:Exported File FTP Server 1Note: You can download the Sample Exported CSV.

How to Automate the Product Export?

To automate the product export, navigate to Dashboard > WooCommerce > Product Im-Ex > Settings. The window appears as shown below:FTPSettingsImpEx-2

  • Select the checkbox to enable FTP import/export.
  • Enter FTP Server Host/IP.
  • Enter FTP User Name.
  • Enter FTP Password.
  • Select Use FTPS checkbox to connect securely.
  • Choose Enabled option to automatically Export products to FTP Server Host/IP, as shown below:Export FTP Settings 2
  • 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 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 products details on 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 40,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!

3 thoughts on “Setting Up Cron Job – WooCommerce Product Import Export Plugin

Leave a Reply

Your email address will not be published. Required fields are marked *