Welcome Last updated: 15.04.2024

Welcome to the documentation for the XML Import Pro v2 extension for a OpenCart.

Here you can find all of the information about the installation of the extension, activation, settings, cron settings, etc..

All sections are explained with examples shown below.

If you need help or you have any questions, please use our Support Page

About module

XML Import Pro is a professional extension for importing products from arbitrarily structured XML files.

Setup and operation is intuitive and very easy.

If you have more than one supplier, you can add more and more XML feeds. Each one will be separated

To Import products, you can press the Import button manually or you can also set a CRON job script.

If you have a large XML file with many products, you can "split" the import (1-10 parts) - this prevents shutdown of the import, if you have a slow server or limits for running scripts on your server.

XML Import Pro includes the "Update Product" feature - you can select which items will be updated. This prevents rewriting when you edit imported products manually.

The extension has Multi-language support for product, category, attribute and option descriptions.

After import, new products can have status as "Disabled" or quantity as "zero"

You can also edit the price of imported products (fixed +/- or by percentage value)

To import products to a specific category of your online store you can use "Category Mapping" - simply select which xml category will be assigned to your online store category.

  Try DEMO

Video

Preview of XML Import PRO:

Screens

Installation Last updated: 15.04.2024

Installation of XML Import PRO is really easy and takes 5 minutes max..

You don't need be programmer or web expert. Everything is prepared for simple installation.

Purchase extension

Purchase extension only from official opencart.com site or from partner sites (deawid.com, opencart.cz, opencart-support.com), because you need ORDER ID for activation.

 

Link to extension:

Get XML Import PRO v2

 

 

 

 

After purchase go back to your account and click to "Your downloads"

Select what version of opencart you have and click to Download

And save extension file

Install extension

  1. Login to your opencart administration.
  2. Go to Extensions > Installer
  3. Click the Upload button and upload the extension file
  4. After successfully uploading, click the Install button

After success installation go to Extensions > Extensions and select Modules

And click to Install button

Setup module Last updated: 15.04.2024

Here is the explanation of all settings for the extension.

Feed settings

Explanation of all items in Feed settings tab:


Main settings:

  • Feed name

    Name of XML feed

  • Feed URL

    URL of XML feed

  • Product tag

    Repeating product tag content (example)

  • Primary key

    Unique key for each product (example)

  • Category name separator

    You can divide full category path and import each category separated (example)

  • Multi feed

    Update products only from this feed or update products from a different feed by unique key

  • Feed status

    Status of feed - if disabled then CRON will not run import/update


Import / Update setting:

  • Language

    Main language for product descriptions

  • Product status

    Status only for new inserted products

  • Category status

    Status only for new inserted categories

  • Require Shipping

    Require product shipping

  • Subtract stock

    Subtract product stock quantity

  • Subtract option stock

    Subtract option stock quantity

  • Required option

    Required option to purchase

  • SEO Keyword - product

    Select type of SEO keyword for products

  • SEO Keyword - category

    Select type of SEO keyword for categories

  • SEO Keyword - manufacturer

    Select type of SEO keyword for manufacturers

  • Import into store

    Check where you want import products


Default values:

  • Out Of Stock Status

    Product status status when a product is out of stock

  • Tax class

    Tax class for product price

  • Length class

    Type of length value

  • Weight class

    Type of weight value

  • Special price - customer group

    Select customer group for special price

  • Default product quantity

    Default product quantity if missing in XML

  • Default manufacturer

    Default product manufacturer if missing in XML

  • Default attribute group

    Default attribute group if missing in XML

  • Default option name

    Default option name if missing in XML

  • Default option quantity

    Default option quantity if missing in XML

  • Option type

    Default option type


Actions:

  • Old product

    Products which are in your Online Store but not in XML anymore

  • Edit price

    Allow editing the price while importing products

  • Edit price - definition

    Change price for product and options when inserting / updating. For example: "+" "12.34" "Fixed"

  • Update data

    Check what you want update if product already was imported

Tag settings

Explanation of all items in Tag settings tab:


  • Tag name

    Name of XML tag

  • Tag value

    Example value from XML tag

  • Assign as

    Select which type of content is in XML tag

Category mapping

Explanation of all items in Category mapping tab:


  • Scan XML for categories

    This button opens the XML file and scans it to get list of all XML categories - must be selected category tag content in Tag settings

  • XML category

    Name of XML Category

  • Eshop category

    Select where you want to import products from XML category to your Online Store category

Import / Update

Explanation of all items in Import / Update tab:


  • Full import

    Button for running import manually

  • Test import

    Import only the first product from XML - recommended to debug import product data

Cron setting

Explanation of all items in Cron setting tab:


  • Total parts

    Select how many parts you want - 10 parts = 10 links

  • Part interval - minute

    Generate parts with time intervals

Info tab

Explanation of all items in Info tab:


Feed info:

  • Feed size

    File size of XML feed

  • Date created

    Date the feed was created

  • Date modified

    Date of the last feed modification

  • Feed status

    Actual status of the feed

  • Total imported products

    Total imported products from last import


Feed info:

  • PHP - max_execution_time

    Maximum time in seconds a script is allowed to run before it is terminated by the parser

  • PHP - memory_limit

    Maximum amount of memory in bytes that a script is allowed to allocate

  • PHP - max_input_vars

    Determines how many input variables may be accepted

  • PHP - display_errors

    Determine whether errors should be printed to the screen or not

Customization Last updated: 15.04.2024

If you need some special edits for your XML import, we have prepared 2 customization files for you.

This can edit imported data before insert/update to your online store database.



We strongly recommend making changes only if you know what are you doing.
We take no responsibility for any data loss!


Product customization

This allows you manually set product data from XML

Customization file is located in: custom/custom.php



Explanation of $product_data array:

 $product_data = array(
  'model'           => STRING,
  'sku'             => STRING,
  'upc'             => STRING,
  'ean'             => STRING,
  'jan'             => STRING,
  'isbn'            => STRING,
  'mpn'             => STRING,
  'location'        => STRING,
  'quantity'        => INTEGER,
  'stock_status_id' => INTEGER,
  'manufacturer_id' => INTEGER,
  'price'           => FLOAT,
  'special'         => FLOAT,
  'tax_class_id'    => INTEGER,
  'weight_class_id' => INTEGER,
  'length_class_id' => INTEGER,
  'weight'          => FLOAT,
  'length'          => FLOAT,
  'width'           => FLOAT,
  'height'          => FLOAT,
  'minimum'         => INTEGER,
  'subtract'        => INTEGER,
  'shipping'        => INTEGER,
  'status'          => INTEGER,
  'images'          => ARRAY,
  'attributes'      => ARRAY,
  'options'         => ARRAY,
  'categories'      => ARRAY,
  'description'     => ARRAY
);


Example of $product_data array:

 $product_data = array(
  'model'           => 'example-123',
  'sku'             => 'example-123',
  'upc'             => 'example-123',
  'ean'             => 'example-123',
  'jan'             => 'example-123',
  'isbn'            => 'example-123',
  'mpn'             => 'example-123',
  'location'        => '',
  'quantity'        => 99,
  'stock_status_id' => 1,
  'manufacturer_id' => 8,
  'price'           => 59.99,
  'special'         => 49.99,
  'tax_class_id'    => 2,
  'weight_class_id' => 1,
  'length_class_id' => 1,
  'weight'          => 10,
  'length'          => 20,
  'width'           => 30,
  'height'          => 40,
  'minimum'         => 2,
  'subtract'        => 1,
  'shipping'        => 1,
  'status'          => 1,
  'images'          => array(
    'http://www.domain.com/image-01.jpg',
    'http://www.domain.com/image-02.jpg',
    'http://www.domain.com/image-03.jpg'
  ),
  'attributes'      => array(
    0 => array(
      1 => array( // 1 = language_id
        'group'  => 'Specifications EN',
        'name'   => 'Size EN',
        'text'   => '55 cm EN'
      ),
      2 => array( // 2 = language_id
        'group'  => 'Specifications DE',
        'name'   => 'Size DE',
        'text'   => '55 cm DE'
      )
    ),
    1 => array(
      1 => array( // 1 = language_id
        'group'  => 'Specifications EN',
        'name'   => 'Package EN',
        'text'   => 'Yes EN'
      ),
      2 => array( // 2 = language_id
        'group'  => 'Specifications DE',
        'name'   => 'PACKAGE DE',
        'text'   => 'Yes DE'
      )
    )
  ),
  'options'         => array(
    0 => array(
      1 => array( // 1 = language_id
        'name'       => 'Color EN',
        'value'      => 'Red EN',
        'price'      => 9.99,
        'quantity'   => 5,
        'type'       => 'select',
        'required'   => 1,
        'subtract'   => 1
      ),
      2 => array( // 2 = language_id
        'name'       => 'Color DE',
        'value'      => 'Red DE',
        'price'      => 9.99,
        'quantity'   => 5,
        'type'       => 'select',
        'required'   => 1,
        'subtract'   => 1
      )
    ),
    1 => array(
      1 => array( // 1 = language_id
        'name'       => 'Color EN',
        'value'      => 'Green EN',
        'price'      => 4.99,
        'quantity'   => 9,
        'type'       => 'select',
        'required'   => 1,
        'subtract'   => 1
      ),
      2 => array( // 2 = language_id
        'name'       => 'Color DE',
        'value'      => 'Green DE',
        'price'      => 4.99,
        'quantity'   => 9,
        'type'       => 'select',
        'required'   => 1,
        'subtract'   => 1
      )
    )
  ),
  'categories'      => array(
    0 = array(
      1 => 'CategoryA | CategoryB | CategoryC'
    ),
    1 = array(
      1 => 'CategoryD | CategoryE | CategoryF'
    )
  ),
  'description'     => array(
    1 = array( // 1 = language_id
      'name'             => 'Example productA',
      'description'      => 'full product description',
      'tag'              => 'tag1, tag2, tag3',
      'meta_title'       => 'Example productA meta title',
      'meta_description' => 'Example productA meta description',
      'meta_keyword'     => 'Example productA meta keyword',
    )
  ),
);

Example 01:

Set all imported products with 999 quantity:

 if(isset($product_data['quantity'])){
  $product_data['quantity'] = 999;
}

Example 02:

Set product name with prefix:

 if(isset($product_data['description'][(int)$language_id]['name'])){
  $product_data['description'][(int)$language_id]['name'] = 'ProductPrefix - '.(string)$product_data['description'][(int)$language_id]['name'];
}

Example 03:

Set fixed price if is zero:

 if(isset($product_data['price']) && (float)$product_data['price'] == 0){
  $product_data['price'] = 55.46;
}

Example 04:

Replace product description:

 if(isset($product_data['description'][$language_id]['description'])){
  $product_description = (string)$product_data['description'][$language_id]['description'];
  $product_description = str_replace('SEARCH','REPLACE',$product_description);
  $product_data['description'][$language_id]['description'] = $product_description;
}

Example 05:

Change fixed quantity only in feed_id 3:

 if($feed_id == 3){
  $product_data['quantity'] = 99;
}

Restructure XML

This allows you to restructure the XML before import.

Customization file is located in: custom/restructure.php

This is sometimes necessary if you have a low quality XML file - for example in one XML file the products and categories are separated and assigned only by IDs.
In this case you must restructure the XML to get category name to a product tag element.

Issues Last updated: 15.04.2024

Every web server have different settings, so we write all possible examples of what can be wrong :)

Import stucks

If import sticks and stats don't change like in this screen:

Maximum execution time

If you see an error such as:


Fatal error: Maximum execution time of 30 seconds exceeded in ....................\admin\model\extension\xml_import_pro.php on line XX

You must increase the max_execution_time value on your server. Ask your web host provider to increase this value.

Input variables exceeded

If you see the error message "Input variables exceeded - please increase PHP max_input_vars value":


You must increase the max_input_vars value on your server. Ask your web host provider to increase this value for you.

XML is broken or invalid

If you see the error message "XML is broken or invalid":


Make sure your XML link is correct and return XML content. Simply open your XML link and check if it is correct.

Also check for empty spaces in the Feed URL:

Examples Last updated: 15.04.2024

Here are some examples of import settings for a few different XML files.

Video - setup example