RO CSVI

How to load a patch file?

| RO CSVI

To load a patch file take the following steps:

  1. Go to Components -> RO CSVI -> Maintenance
  2. Select RO CSVI
  3. Select Load patch file, you now see this screen:
    CSVI Pro load patch file
  4. Click on Browse and select the patch file provided to you by the forum
  5. Click on Continue
  6. Your patch file has now been loaded

Read more ...

Manage timeouts

| RO CSVI

When doing any kind of import, it is not uncommon to run into timeout problems. There are several reasons for this:

  • The import file is too big for your server settings
  • Retrieving external images takes too much time
  • Incorrect template settings

Why does the server have limits?

The server has limits to prevent you from overloading and possibly bring down the server. This is usual on shared hostings because the hosting provider doesn't want you to trouble your neighbours, same as you don't want your neighbour to bring down the server. If you have a VPS you have more freedom to do what you like as you have more resources available. On a dedicated server you can do as you please as you are the only one on the server, bringing it down will only affect you.

How do I change the server limits?

You can't is the short answer. Hosting providers have these limits in place to make sure the server does not get overloaded on shared hosting accounts. If you have a VPS or dedicated server, you can probably increase the server limits to whatever you have available on your server. Contact your hosting provider on how to do this for your server.

How to change the CSVI import limits?

The import limits used by CSVI can be changed in the template after clicking on the Advanced button. This will show the Limit tab and it's options.

Template limit

By setting the Override system limits to Yes, these settings are activated. On import CSVI will set these settings but this is no guarantee that they will be used. The server can and usually is setup to ignore these settings, on a dedicated server this usually can be used. The advice is not to use these settings unless you are sure they can be used on your server.

The Limit tab contains 2 settings:

  • Lines per import
  • Time between imports
    No need to change this one

The Lines per import is the one we are going to change, as it determines how many lines CSVI should read before restarting. How many lines this needs to be depends on your server. A rule of thumb is that an import run cannot last longer than 30 seconds, so you need to find out how many lines you can process within 30 seconds. A value of 0 means, read the whole file, never restart. Any other value will be the number of lines CSVI processes before restarting.

An example, your file has 5000 lines to import but the import stops at 543 lines because that is what the server can handle in 30 seconds. We set the Lines per import to 400 and save the settings. What happens now is that CSVI process the first 400 lines, waits 5 seconds and restarts. After the restart it reads the next 400 lines, waits 5 seconds and restarts again. This process continues until CSVI has read all 5000 lines and then finalizes the import.

If you find out that with Lines per import set to 400 it still times out, lower the number to 300 and try again. This is always a trial and error process since it all depends on your server.

Large files, what do I need?

You need patience, large files take time to import.

What is the perfect setting for my large file?

There is no answer to this, since it is your file, you will have to test the settings for your file on your server.

Read more ...

Fill multiple fields with one value

| RO CSVI

Requirements

  • CSVI 5.0+
  • VirtueMart 2.0.2
  • Joomla 2.5+
  • PHP 5.2+
  • An existing product import template
  • Basic understanding of adding fields to templates

Objective

The objective is to import 1 field from the import file into multiple destination fields. In this example we will import the product name into the fields product name and product short description.

Example data

"product_sku";"product_name"
"AB123";"Product 1"
"CD456";"Product 2"

Setting up the fields

Follow these steps to setup the fields as above:

Field configuration

  1. Select the product_sku field and click on Add
  2. Select the product_name field and click on Add
  3. Select the product_s_desc field and click on Add

Now we have all the three fields as shown in this image:

Import multiple destination fields

 

Configuring the additional destination fields

Now we need to set up the product short description to take the value from the product name as shown below:

Configure additional field

  1. On the Fields tab click on the product_s_desc field to open the edit screen as shown in the image above
  2. At File field name fill in the field name as set in the field you want to take the value from. In this example we take it from the product_name field. If this field is empty, add the same name as chosen at Template field name. As this field is empty in the product_name field, we add the full name product_name.
  3. At the Template field name select from which field the product short description should take its value. We want to take the value from the product_name field, so select the product_name field.
  4. Click on Submit

 

To make sure that the import uses these settings we just created the option Use column headers as configuration must be set to No. See the settings here:

Import settings combine fields

The settings are done and the file options are set now and the template is ready for import.

Read more ...

Import XML

| RO CSVI

This tutorial will explain how to:

  • Analyze the XML file
  • Setup an import template for the XML file
  • How to import the XML file

Requirements for this tutorial are:

  1. CSVI Pro 6.0+
  2. This attached XML file

Analyzing the XML file

Open the attached XML file in an editor. There are a few things to see:

  1. Root element
  2. Node element
  3. Record element
  4. Item element

Root element

The root element is the <catalog> tag in the file. This contains all the node and record elements. CSVI does not use the root element so we can forget this one.

Node element

The node element is the <products> tag in the file. This contains all the record elements. CSVI does not use the node element either so we can forget this one also.

Record element

The record element is the <product> tag in the file. This contains all the details of the item in our case. The record element is very important for CSVI, this is how it identifies where to start reading your file. Therefore we need to put the record element in the XML options in the template as shown here. The element is written without the brackets.

Item element

The item elements contain all the item information. This is what we need for setting up the template fields but more about that later.

Setup an import template for the XML file

First create a new template by taking these steps:

  1. Go to Components -> CSVI Pro -> Templates Tab
  2. Provide a name for the template
  3. Under Operations make the following selection:
    1. Import
    2. VirtueMart
    3. Product import
    4. Click on Save or Save & Close

  1. On the File tab, set Use file for configuration to No
  2. Now save the template by clicking on the Save or Save & Close button. This step is needed so we can add the fields to the template.
  3. The template is now ready to be configured

Adding the fields

The most important part of the template are the fields, this is where CSVI is told what to do with the import fields. The order of the fields is not important as CSVI identifies fields based on their name. There is only one case where the order is important, that is with fields with the same name, this will be explained later. All field names are case-sensitive. Pay attention to this. We will take the following steps:

  1. Identify the XML paths
  2. Identify the CSVI fields
  3. Add the fields to the template
Identify XML paths

A field name is created by CSVI based on the path in the XML file, the path always starts from the item element. First we will create the path names of the items in the attached XML file.

  1. Element: <ID>
    Path: ID
  2. Element: <NAME>
    Path: NAME
  3. Element: <DESCRIPTION>
    Path: DESCRIPTION
  4. Element: <PRICE>
    Path: PRICE
  5. Element: <PRICE_BASE>
    Path: PRICE_BASE
  6. Element: <PRICE_RES>
    Path: PRICE_RES
  7. Element: <IMAGES><IMAGE1>
    Path: IMAGES/IMAGE1
  8. Element: <IMAGES><IMAGE2>
    Path: IMAGES/IMAGE2
  9. Element: <IMAGES><IMAGE3>
    Path: IMAGES/IMAGE3
  10. Element: <IMAGES><IMAGE4>
    Path: IMAGES/IMAGE4
  11. Element: <VIDEO1>
    Path: VIDEO1
  12. Element: <VIDEO2>
    Path: VIDEO2
  13. Element: <VIDEO3>
    Path: VIDEO3
  14. Element: <FEATURES><FEATURE name>
    Path: FEATURES/FEATURE/NAME
    This path is used multiple times for the other features
  15. Element: <FEATURES><FEATURE>
    Path: FEATURES/FEATURE
    This path is used multiple times for the other features
  16. Element: <SIZE>
    Path: SIZE
  17. Element: <GROUPPRODUCTS>
    Path: GROUPPRODUCTS
  18. Element: <STATUS>
    Path: STATUS
  19. Element: <CATEGORY>
    Path: CATEGORY
  20. Element: <BARCODE>
    Path: BARCODE
Identify CSVI fields

Now that we have all the paths identified we need to identify the CSVI fields the paths belong to. A visual guide is available for the fields name to help you identify the fieldnames. Hereby the list of fields for the example XML:

  1. Path: ID
    CSVI: product_sku
  2. Path: NAME
    CSVI: product_name
  3. Path: DESCRIPTION
    CSVI: product_desc
  4. Path: PRICE
    CSVI: product_price
  5. Path: PRICE_BASE
    CSVI: skip
    This field is skipped because there is no equivalent field available, this applies to all fields being skipped.
  6. Path: PRICE_RES
    CSVI: skip
  7. Path: IMAGE/IMAGE1
    CSVI: file_url
  8. Path: IMAGE/IMAGE2
    CSVI: combine
    This field is going to be combined with the file_url field because there is only 1 field available to specify images.
  9. Path: IMAGE/IMAGE3
    CSVI: combine
  10. Path: IMAGE/IMAGE4
    CSVI: combine
  11. Path: VIDEO1
    CSVI: skip
  12. Path: VIDEO2
    CSVI: skip
  13. Path: VIDEO3
    CSVI: skip
  14. Path: FEATURES/FEATURE/NAME
    CSVI: custom_title
  15. Path: FEATURES/FEATURE/NAME
    CSVI: combine
  16. Path: FEATURES/FEATURE/NAME
    CSVI: combine
  17. Path: FEATURES/FEATURE
    CSVI: custom_value
  18. Path: FEATURES/FEATURE
    CSVI: combine
  19. Path: FEATURES/FEATURE
    CSVI: combine
  20. Path: SIZE
    CSVI: skip
  21. Path: GROUPPRODUCTS
    CSVI: skip
  22. Path: STATUS
    CSVI: published
  23. Path: CATEGORY
    CSVI: category_path
  24. Path: BARCODE
    CSVI: skip
Add the fields

Now that we have identified the paths and fields, we are ready to add all the fields to the template. We do this by following this procedure:

  1. Click on the Template Fields tab to open the fields section
  2. From the Field name dropdown select the CSVI field
  3. In the Your field name field type the XML path. Do not forget that the file field name is case-sensitive.
  4. Click on the Save or Save & Close
  5. Repeat these steps for all fields
Combine fields

The next step is to configure the combine fields to make sure all the fields get combined.

As mentioned earlier, we are going to combine the image fields because there is only 1 field for an image available. To combine the images we need to edit the field name, this is done by clicking on the field name. The steps are:

  1. Go to Rules
  2. Click on New
  3. An edit screen opens as seen on the screenshot above
  4. Enter a name for the rule that is easy to recognize
  5. Set the Action to import as we are using this rule for an import
  6. Choose the Plugin named CSVI Field combine
  7. Click on Load Plugin
  8. Click on Save to store the settings and after that we can fill in our fields
  9. Next we need to define the source fields. These are the fields that we want to combine. We have 4 images in total, the first one is linked to the file_url field and the other 3 need to be combined with the first one. We do this by specifying all the fields we want to combine. Since this is an XML file, we need to use the XML path instead of the CSVI name. So our list will look like this file_url,IMAGE/IMAGE1,IMAGE/IMAGE2,IMAGE/IMAGE3,IMAGE/IMAGE4.
  10. In the Target field we specify where the combined value is stored. In our case this is the file_url field.
  11. Next in the Combine character we need to set which character we want to use to combine the fields. Multiple images are always separated by a pipe-symbol |, so we fill in the pipe-symbol.
  12. Click on Submit to save the changes
  13. Do the same for the custom_title and custom_value fields.
  14. The fields are now all added and set up

 How to import the XML file

 The last step is to import the XML file.

  1. Click on Import tab
  2. Select the template created for XML Import
  3. Click on Select file from top right corner

  1. Click on Choose File (text may vary depending on the browser used)
  2. Select the file on your computer
  3. Click on Preview in the top left corner
  4. CSVI will show the preview of content of the file. Now click on Start Import to start the import of XML file

Read more ...

Override import/export routines

| RO CSVI

Background information

An override is where you create your own routine and place it in a specific folder for RO CSVI to use. This way you can add or modify the behavior of RO CSVI when importing or exporting to suit your own needs. The system allows for great flexibility so you can write your own override import/export routines and not having to worry that by updating RO CSVI your changes are lost.

Read more ...

Subcategories