RO CSVI
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.
500 Internal Server Error
| RO CSVI
The Internal Server Error is probably the worst error you can get. The error means that the server is telling you something went wrong but not what has gone wrong. It is now up to you to find out what has gone wrong.
Kown causes
There are a number of known causes and easy fixes:
- Folder and or files do not have the correct privileges
- Solution: Set the correct privileges for the folders and files
Folders should have permission 755
Files should have permission 644
- Solution: Set the correct privileges for the folders and files
- Missing folders and or files
- Solution: Re-install necessary packages and/or patches
- Trying to resize images that are too large
- Solution:
- Make sure your large images are not too large
- Create your own thumbnails
- Set the maximum size of the large image RO CSVI should create a thumbnail for
- Solution:
- Old PHP version
- Solution: Check that the PHP version used is at least 7.4 but recommended is PHP 8.0 or higher
- BOM in your file
- Solution: Set the Auto-detect delimiters to No in your template and specify them manually in the template.
- Export of SEF URLs
- Solution: When exporting SEF URLs it can be a huge strain on the server. Instead of generating SEF URLs during export you can pre-fetch the SEF URLs by going to Maintenance -> Select your extension -> Refresh SEF URLs. This will populate the database with the generated SEF URLs and the export will read them from the database instead of requesting them from the server. Make sure you have set the Domain name in the RO CSVI Settings.
- Incompatible addon versions
- Solution: Check that RO CSVI and the addons are all the same version. Enable the option Check addon version in the RO CSVI Settings
Error reporting
In some cases the 500 Internal Server Error can be changed to a visible error by setting the Error Reporting to Development as explained in the steps below.
- Go to System -> Global Configuration
- Click on the Server tab
- Set Error Reporting to Development

- Click on Save & Close
Once the Error Reporting is set to Development, run the import again and see if you get the real error. If not, you will have to check the Server error log section.
Server error log
The real error is in the server error log. This may not be a log you have access to, so contacting the hosting provider is advised in that case. Explain to them the situation and that you would like to know which error has been generated by the server. With the real error in hand it should be easy to fix the issue. If you need help, post the real error in the forum and we will gladly assist you.
Not Acceptable error
| RO CSVI
Requirements;
CSVI Pro 5.8+
The following error can be seen on some restrictive servers:
"Not Acceptable
An appropriate representation of the requested resource /administrator/index.php could not be found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."
Fixing the problem
- Login
- You may see an empty screen, click the logout button. This is to reset your session.
- Login again
- Go to Components -> CSVI Pro -> Settings
- Set to the option Use cookies to No
- Save the settings
- You should be able to use CSVI now
Error building Admin Menus
| RO CSVI
This is an issue caused by Joomla and the only way to fix this is to manually clean up your system. To clean up your system take the following steps:
- Delete all references in the jos_extensions table where element is com_csvi. Replace jos with your own prefix. Find them with this command:
SELECT * FROM `jos_extensions` WHERE element="com_csvi"
- Delete all references in the jos_assets table where name is com_csvi. Replace jos with your own prefix. Find them with this command:
SELECT * FROM `jos_assets` WHERE name="com_csvi"
- Delete all references in the jos_menu table where title is like com_csvi. Replace jos with your own prefix. Find them with this command:
SELECT * FROM `jos_menu` WHERE title LIKE "COM_CSVI%"
- Now install CSVI again as outlined in the Install CSVI in 5 steps tutorial.
Process XML files
| RO CSVI
Basic XML
CSVI has the option to import and export products in the XML format. The XML format by itself is an open standard, this means it has no fixed structure. The structure is defined by the program itself and is called an XML schema. For CSVI the structure looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<channel>
<item>
</item>
</channel>
Every XML file needs to start with the line:
<?xml version="1.0" encoding="UTF-8"?>
This line tells the program it is an XML file and data is encoded in UTF-8.
The second line starts the group of data and looks like:
<channel>
Each set of data is contained in a node called “item”. The node starts like:
<item>
Now the data to import follows. Inside the node we use tags to identify the type of data that is being imported or exported. A tag is exactly the same as a column in a spreadsheet. A single tag looks for example like:
<product_sku>LAP01</product_sku>
- The opening tag is
<product_sku>
- The data is CSVI101
- The closing tag is
</product_sku>
It is important that each tag is closed otherwise the XML file is invalid.
After all the data is added to the node, the node also needs to be closed. Closing the node is done like this:
<item>
Either a new node can be opened now for the next set of data or the XML file can be closed. To close the XML file, first the channel needs to be closed by adding this line:
</channel>
The file is now complete and ready to be saved and processed.
An example XML file can look like this:
<channel>
<item>
<product_sku>LAP01</product_sku>
<product_name><![CDATA[Laptop Type 01]]></product_name>
<category_path>Computers/Laptops</category_path>
</item>
</channel>
This is a basic setup of an XML file. This example also shows the usage of the CDATA tag. This is a special tag and is used to tell the system that any data inside the CDATA tag is not to be read as XML data but as plain data. This is for example necessary when the data contains a special character like the ampersand (&). For full details, have a look at the Wikipedia XML page. On export, CSVI already adds the CDATA tag automatically to fields considered to usually have special characters. CSVI offers several XML export formats to serve for different shopping sites. These sites are:
- Beslist.nl
- Google Merchant
Each of these sites have their own XML schema and it is advised to read on how to use this. An example of this is the Google Base example template.
Advanced XML
CSVI can now import complex XML structures. To be able to import complex XML structures, you need to tell CSVI how your structure looks like. The structure is set in the XML Record Nodes field. This field must contain the blueprint of your XML structure.
Simple structure
The CSVI XML format uses a simple structure that looks like this:
<channel>
<item>
<product_sku></product_sku>
<product_name></product_name>
</item>
</channel>
Every record is enclosed between the <item></item> tags. The XML Node field can then be filled like:
- <item></item>
- <item/> (self-closing)
Complex Structure
An XML file can also contain a complex structure like this:
<product>
<id>A2045</id>
<name>Great Product</name>
<description_it>My great product</description_it>
<price>10.52</price>
<weight unit="kg">
<unit>kg</unit>
</weight>
<images>
<image1>myimage.jpg</image1>
</images>
</product>
Every record is here enclosed between the <product></product> tags however the tagnames do not have a name according to the fields in the Available fields list. Further the image is contained in a subnode called <images>.
The field <weight unit="kg"> indicates there is a subnode called unit that is being matched to a fieldname called kg. Now the fieldname kg does not exist but it is called product_weight_uom. This we will need to adjust for the blueprint.
To make CSVI understand this format it is necessary to tell CSVI how to read the XML file. A blueprint of the above example will look like this:
<product>
<id>product_sku</id>
<name>product_name</name>
<description_it>product_desc</description_it>
<price>product_price</price>
<weight unit="product_weight_uom"></weight>
<images>
<image1>product_full_image</image1>
</images>
</product>
The field to use must be placed between the node names for example <id>product_sku</id> will tell CSVI that the ID field is the product_sku field.
Special tags
Note: CSVI Pro 4.4 required
As of CSVI Pro 4.4, you can now also import XML structures with duplicate nodes by using special tags. These tags are:
- csvi="combine"
- csvi="add"
When using these special tags, you cannot use the template fields to match the structure of the XML file. However it is possible to add extra fields to the template and enable the option Add extra fields. These fields will be added to the end of each item. Give these fields a default value and they will be imported also. This can be used to publish your products immediately for example.
We will use this example node:
<product>
<id>R254617</id>
<name>Printer</name>
<features>
<feature>Multi-color - Yes</feature>
<feature>Condition - Refurbished</feature>
<feature>Speed - 5ppm</feature>
</features>
<images>
<image id='1'>
<url><![CDATA[http://www.example.com/image1.jpg]]></url>
<primary>1</primary>
</image>
<image id='2'>
<url><![CDATA[http://www.example.com/image2.jpg]]></url>
<primary>0</primary>
</image>
</images>
</product>
Combine
The combine option is used to combine duplicate nodes into 1 field. Look at the example node, this printer has 3 features. The next printer in the import file might have 5 features. Since these features are variable, it is not possible to match them with different fields in CSVI. The combine option will make it possible to match them with 1 field, for example the product description. By setting the combine tag on the feature node, CSVI will merge all fields that match the <features><feature> path.
Add
The add option is used to import duplicate nodes into different fields. Look at the example node, this printer has 2 images. The add option will make it possible to match them with a field of your choice. By setting the add tag on the image node, CSVI will match all next nodes to the given fieldname. All fields that match the <images><image> path will be handled by the add option.
The blueprint for this XML node will look like this:
<product>
<id>product_sku</id>
<name>product_name</name>
<features><feature csvi="combine">product_desc<feature></features>
<images>
<image id='skip'>
<url csvi="add">file_url</url>
<primary>skip</primary>
</image>
<image id='skip'>
<url>file_url_thumb</url>
<primary>skip</primary>
</image>
</images>
</product>
Custom XML
The custom XML export gives you the flexibility of exporting any kind of XML layout.
Setting Up The XML Layout
The XML layout has 3 parts that needs to be set up. The parts are:
- Header
- Body
- Footer
Header
The header contains the start of the XML file. Example:
<?xml version="1.0" encoding="UTF-8"?>
<channel>
Body
The body contains a single node that will be duplicated for every export item. A node is build up from several sections:
- Opening tag
The opening tag starts the node, for example: <product> - Fields
The fields specify what information is going to be exported, for example:<id>[product_sku]</id>A field is constructed of 3 different parts:
<name>[product_name]</name>
<description_it>[product_desc]</description_it>
<price>[product_price]</price>
<weight unit="[product_weight_uom]">[product_weight]</weight>
<images>
<image1>[picture_url]</image1>
</images>- Start tag
<id> - Field to be exported. The field that is going to be exported must always be enclosed in square brackets.
[product_sku] - Closing tag
<id>
- Start tag
- Closing Tag
The closing tag closes the node, for example: </product>
Each field that is going to be exported needs to be added to the list of fields to be exported on the Export tab. Example:
<product>
<id>[product_sku]</id>
<name>[product_name]</name>
<description_it>[product_desc]</description_it>
<price>[product_price]</price>
<weight unit="[product_weight_uom]">[product_weight]</weight>
<images>
<image1>[picture_url]</image1>
</images>
</product>
Footer
The footer closes the XML file. Example:
</channel>
Output File
The above example will generate the following output file:
<channel>
<product>
<id>P01</id>
<name><![CDATA[Chain Saw]]></name>
<description_it><![CDATA[
<ul>
<li>Tool-free tensioner for easy, convenient chain adjustment </li>
<li>3-Way Auto Stop; stops chain a fraction of a second </li>
<li>Automatic chain oiler regulates oil for proper chain lubrication </li>
<li>Small radius guide bar reduces kick-back </li>
</ul>
<p><br /> <strong>Specifications</strong><br /> 12.5 AMPS <br /> 16" Bar Length <br /> 3.5 HP <br /> 8.05 LBS. Weight</p>
]]></description_it>
<price>2,99</price>
<weight unit="pounds">10.0000</weight>
<images>
<image1>http://www.example.com/components/com_virtuemart/shop_image/product/c3a5bf074da14f30c849d13a2dd87d2c.jpg</image1>
</images>
</product>
</channel>