1. upir
  2. RO CSVI
  3. Monday, 26 January 2015
  4.  Subscribe via email
Hello Rolandd,

I asked our new supplier for a XML file which I would need to use to import products into VM. They only have PMA XML format. Is there any way how to import this kind of data into VM using CSVI? I tried to use the PMA XML like normal XML, but CSVI did nothing, even no log file was made.
I also asked the supplier how other their clients do imports and they just said that, nobody has problem with that. Perhaps I don't understand something in the XML file.

Here is the XML file: http://objednavky.4ever.cz/xml/bikes.xml
Joomla 3.3.6
CSVI 5.20
VM 3.0.2

Tank you.

Regards
Fanda
Accepted Answer Pending Moderation
Hello Fanda,

What are the problems you have importing this file? Looking at the file one record is this
<table name=""><column name="id">1667</column><column name="kod">K4E 15001 16</column><column name="kategorie">VIRUS celoodpružená</column><column name="typ">VIRUS SXC X0 </column><column name="nazev">VIRUS SXC X0 </column><column name="rocnik">2015</column><column name="voc"/><column name="voc_dph">99990</column><column name="moc"/><column name="moc_dph">124990</column><column name="barva">cerna/seda</column><column name="ram">16.5</column><column name="pocet"/><column name="specifikace_url">http://4ever.cz/katalog/kolo/2015/virus-celoodpruzena/virus-sxc-x0</column><column name="image_url">http://objednavky.4ever.cz/files_web/bikephoto/big/1667.jpg</column><column name="availibility">0000-00-00</column><column name="action">1</column></table>


You would map the kod column to product_sku, the kategorie to category_path etc. That should import just fine.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hello Rolandd,

I have tried many times to import that with different configurations, but still without success. At first I don't understand what should I use as a record name in CSVI. I prepared a test XML file where only 1 product is and also tried to add a name to <table name="">. Then only thing that CSVI sometimes writes is NO PRODUCT_SKU FOUND but in most time it just writes NO LOG DETAILS HAVE BEEN FOUND and 0 products processed.

The test XML file and a log file attached.

Thank you

Regards
Fanda
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hey Fanda,

I prepared a test XML file where only 1 product
That is a good start.

Please post a screenshot of how you have configured the fields in your template. In your template you need to set the XML record name to table. Let's start with that first.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hi Rolandd,

I prepared an easier field configuration, set the record name to table and the field product_sku to kod or "kod" or name="kod" or column name="kod", tried to use headers/nodes as configuration or Add extra fields but it still says NO PRODUCT SKU FOUND. Screenshots attached.

Thank you

Regards
Fanda
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello Fanda,

Ok the file option tab looks good to me, don't touch it anymore :)

So to help you figure out how to process your XML, I have created a test import and it is looking a bit unusual but it works. Please look at the attached screenshot, it has the first 3 fields from your XML:
<column name="id">751</column>
<column name="kod">K4E 11281 19</column>
<column name="kategorie">VIRUS Krosová</column>

The first 2 skip fields are for the id column, the next skip and product_sku fields are for the kod column and finally the skip and category_path are for your kategorie column.

You need to copy what I have done and continue this for all fields in your XML, you cannot skip any of the columns in your file.

That should get you your products imported.
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hi Rolandd,

thank you for your answer. The example you tried seems like working all right, but when you try to import more than 3 fields (columns), the CSVI's behavior i quite unusual.

[code type=xml]<column name="id">751</column>
<column name="sku">K4E 11281 19</column>
<column name="kategorie">VIRUS Krosová</column>
<column name="typ">toto pole nemá být název</column>
<column name="nazev">NÁZEV</column>
<column name="fanda">Fanda název</column>[/code]

1-3 rows work fine. The 4th and 5th row should be skipped and 6th row should be imported as a product name. But instead of that it always imports the 4th row as the product name and ignores the SKIP in fields configuration. But the 1st line is also skipped and this one works ok. I don't understand.

Do you have any idea how to make CSVI imports this kind of XML file?
Is there any possibility how to combine this kind of fields? I didn't try that, but is seems like a next problem for me. I would need to make the product name by combining 3 fields (names, year and size), it should look like other products in our eshop.

Thank you.

Regards
Fanda
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello Fanda,

The XML fields you posted in your previous message do not match the XML you posted. Is this another file you are importing?

As for the skip field not working later on, that is because all the XML nodes are called the same as column/name. The only thing I can come up with now is that you create a custom field of the type String and set it to Unpublished for each field. So the first field in your XML is
<column name="id">751</column>
for this your create the 2 custom fields called fieldid and fieldidvalue. The second field in your XML is
<column name="kod">K4E 11281 19</column>
for this your create the 2 custom fields called fieldkod and fieldkodvalue. The third field in your XML is
<column name="kategorie">VIRUS Krosová</column>
for this you create 1 custom field called fieldkategorie. The second field is not needed here because you are using category_path. So you do this for all your fields. Once you are done you go to CSVI -> Available Fields and click the Update button. This way you tell CSVI there are new fields.

After the update is completed go back to your template. Change all the skip fields to the correct new field you created. So the first skip field from your screenshot becomes fieldid, the second field in your screenshot becomes fieldidvalue. Do this for all the fields. The fields that you actually want to use in CSVI, you keep as they are such as product_sku, category_path, product_name etc.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hello Rolandd,

I did some changes in the test file to try do do as many tests as possible before I posted another question.

The procedure you suggested is good until the XML file contains something like that
[code type=xml]<column name="moc"/>[/code]
or that
[code type=xml]<column name="image_url">
http://objednavky.4ever.cz/files_web/bikephoto/big/1670.jpg
</column>[/code]

The character / ends the procedure of importing a field, but because of the nonstandard fields configuration, there is #TEXT expected, so the CSVI grabs another #TEXT, which makes the import of some products void and makes it impossible to import images from an URL because it always contains the character /. Or at least this is my opinion why CSVI doesn't do the import correctly.

Is there any way how to cope with this?

I asked our supplier for a different kind of the XML file again, but because of their XML is a valid type of XML file, they don't want to do any changes just because of one their client.

Thank you

Regards
Fanda
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello Fanda,

I asked our supplier for a different kind of the XML file again, but because of their XML is a valid type of XML file, they don't want to do any changes just because of one their client.
Sure it is a valid XML that your supplier send you but this is my dislike with XML. No structure is ever the same, so CSVI tries to support the world where the world only cares about 1 XML structure. If you write your own XML parser then you can build it to deal with this exact structure.

The character / ends the procedure of importing a field, but because of the nonstandard fields configuration, there is #TEXT expected, so the CSVI grabs another #TEXT, which makes the import of some products void and makes it impossible to import images from an URL because it always contains the character /. Or at least this is my opinion why CSVI doesn't do the import correctly.
The file URLs is not the problem I think because I have imported XML files in the past with images but your first example of the
<column name="moc"/>
can be problematic indeed because there is no value for that field. There is no solution for that in CSVI. XML files are a pain to work with unless you write your own XML parser so you can tell it exactly what to expect.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hello Rolandd,

I would also like that every our supplier use the same form of XML. I even thought that this kind of XML is not valid and I asked them for something "normal", but... I understand this is not easy to meet everyone.

The file URLs is not the problem I think because I have imported XML files in the past with images

I think in this case a URL has to be in "..." because CSVI expects #TEXT. When I removed / from the URL (just for test) it worked fine. But this will not be the worst problem for me, I can prepare a different method how to import images.

The problem with
[code type=xml]<column name="moc"/>[/code]
is the worse one for me. What I need the most from this import is the update of stock status. I have an Idea how to solve this problem. I will post here my solution, if I prepare some :-)

Thank you

Regards
Fanda
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Hello Fanda,

I think in this case a URL has to be in "..." because CSVI expects #TEXT. When I removed / from the URL (just for test) it worked fine.
Aha, I see. It should be enclosed in CDATA tags. I don't remember of the XML I tested with had that.

Does CSVI stop processing at the <column name="moc"/> field or the field layout doesn't align?
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 11
Accepted Answer Pending Moderation
Hello Rolandd,

Does CSVI stop processing at the <column name="moc"/> field or the field layout doesn't align?

No, CSVI doesn't stop processing at this type of fields.
This is an example of a product with this fields:
[code type=xml]<table name="">
<column name="id">1669</column>
<column name="kod">K4E 15003 20</column>
<column name="kategorie">VIRUS celoodpružená</column>
<column name="typ">VIRUS SXC X0</column>
<column name="nazev">VIRUS SXC X0</column>
<column name="rocnik">2015</column>
<column name="voc"/>
<column name="voc_dph">99990</column>
<column name="moc"/>
<column name="moc_dph">124990</column>
<column name="barva">cerna/seda</column>
<column name="ram">20.5</column>
<column name="pocet"/>
<column name="specifikace_url">
http://4ever.cz/katalog/kolo/2015/virus-celoodpruzena/virus-sxc-x0
</column>
<column name="image_url">
http://objednavky.4ever.cz/files_web/bikephoto/big/1669.jpg
</column>
<column name="availibility">0000-00-00</column>
<column name="action">1</column>
</table>[/code]
When I use the method you suggested, CSVI expects some #TEXT after every COLUMN/NAME. But there is no #TEXT after
[code type=xml]<column name="voc"/>[/code]
or
[code type=xml]<column name="moc"/>[/code]
or
[code type=xml]<column name="pocet"/>[/code]
so CSVI uses a next #TEXT, but than this used #TEXT belongs to a different COLUMN/NAME and it makes some chaos in the final product imported.
For the field [code type=xml]<column name="voc"/>[/code] it uses the value 99990 etc.

I have an idea for an external PHP script, which would import this XML file, overwrite every fields by some that CSVI is able to understand to, save this new XML somewhere, CSVI can import this new XML. But I'm not a programmer, I understand PHP just a little bit and I'm also not sure about this solution.

I'm sorry that I didn't send a whole product in the test XML when I started this topic. I prepared just a small test file and I didn't know that there could be a problem with URL or there are some fields like these in the XML (they are not in every product)

Thank you

Regards
Fanda
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hello Fanda,

so CSVI uses a next #TEXT, but than this used #TEXT belongs to a different COLUMN/NAME and it makes some chaos in the final product imported.
In that case you leave the #TEXT out from your field list. So in your field list you will have a column/name field and then another column/name field. Doesn't that work?
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 13
Accepted Answer Pending Moderation
Hello Rolandd,
In that case you leave the #TEXT out from your field list. So in your field list you will have a column/name field and then another column/name field. Doesn't that work?

when I use this, it seems like CSVI uses a first free #TEXT, it ignores the standard XML configuration.

For example:
[code type=xml] <column name="id">1669</column>
<column name="kod">K4E 15003 20</column>[/code]
I tried to not use any #TEXT for COLUMN/NAME ID, and it used the value of 1669 for the COLUMN/NAME KOD. Isn't it a bug in CSVI?

Thank you

Best regards
Fanda
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
Hello Fanda,

I tried to not use any #TEXT for COLUMN/NAME ID, and it used the value of 1669 for the COLUMN/NAME KOD. Isn't it a bug in CSVI?
It is not that the #TEXT is linked to the COLUMN/NAME field but it just happens to come out like that.

In your example the column/name matches id and #TEXT matches 1669 because the 1669 is the text that belongs to <column name. Now since CSVI maps every value it finds to a field, you need a field for every value found. That is why I suggested to create a custom field for every value.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 15
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!