Automatic import and update of products from XML to WooCommerce


Automatic import and update of products from XML to WooCommerce

For our client, we have created a WordPress plugin that automatically imports and updates products in WooCommerce based on XML files (product, price and stock feed) from suppliers of advertising gadgets:

  • AXPOL,
  • ANDA,

The updated data includes product data such as assigned categories, prices, states, combinations or product descriptions. The plugin also imports and updates photos from the shared repository. Product import enables data filtering. It can be run both manually from a web browser as well as as a CRON task. It is possible to divide tasks into separate calls, ie separately adding and updating products, photos, updating prices, states, etc. The import is performed iteratively with a configurable number of operations per call in order to ensure stable and reliable operation with a limited script working time.

A dedicated plugin and code importing data from XML to WooCommerce may have advantages over the most popular modules such as WP All Import. Modules of this type offer ready-made functionalities such as mapping XML fields to WordPress or WooCommerce entry fields, managing exchange processes, copying photos, etc., but they are a more closed product. They are a very good start to recognize problems related to import or initial filling of the database and its updating. The practice of large volumes and complex data structures shows, however, that in order to obtain adequate stability or efficiency, the intervention of a programmer is required in many aspects of the import process.

If you are interested in a similar solution, please contact us:

About the author

Thomas editor