1. cyberspyder
  2. RO CSVI
  3. Friday, 06 July 2018
  4.  Subscribe via email
I am trying to import an XML file into Virtuemart. I have

Joomla 3.8.10
PHP 7.2
Virtuemart 3.2.14
CSVI 7.6.2

I get errors for duplicate key on categories. The issue is I can't successfully pull out the category from my file. Here is what an item in the file looks like:
<Item MaintenanceType="A">
<HazardousMaterialCode>N</HazardousMaterialCode>
<ItemLevelGTIN GTINQualifier="UP">00750385002495</ItemLevelGTIN>
<PartNumber>2760SA</PartNumber>
<BrandAAIAID>BBKX</BrandAAIAID>
<BrandLabel>Cloyes</BrandLabel>
<ACESApplications>Y</ACESApplications>
<QuantityPerApplication UOM="ST" Qualifier="REQ">1</QuantityPerApplication>
<ItemEffectiveDate>2008-09-30</ItemEffectiveDate>
<AvailableDate>2009-01-01</AvailableDate>
<MinimumOrderQuantity UOM="EA">1</MinimumOrderQuantity>
<UNSPSC>31171700</UNSPSC>
<PartTerminologyID>10318</PartTerminologyID>
<Descriptions>
<Description MaintenanceType="A" DescriptionCode="DEF" LanguageCode="EN">Engine Timing Gear Set</Description>
<Description MaintenanceType="A" DescriptionCode="EXT" LanguageCode="EN">Set Includes: Camshaft Gear, Crankshaft Gear.</Description>
<Description MaintenanceType="A" DescriptionCode="DES" LanguageCode="EN">Engine Timing Gear Set</Description>
<Description MaintenanceType="A" DescriptionCode="MKT" LanguageCode="EN">Aluminum CAM GEAR, Steel CRANK GEAR. Feature \\&quot;Helical\&quot;\&quot; Tooth Form For Quiet Operation, And Precision Machined Bore For True Fit.&quot;</Description>
<Description MaintenanceType="A" DescriptionCode="SHO" LanguageCode="EN">GEAR SET</Description>
</Descriptions>
<ExtendedInformation>
<ExtendedProductInformation MaintenanceType="A" EXPICode="CTO">US</ExtendedProductInformation>
<ExtendedProductInformation MaintenanceType="A" EXPICode="HSB">8409914000</ExtendedProductInformation>
<ExtendedProductInformation MaintenanceType="A" EXPICode="HTS">8409919990</ExtendedProductInformation>
<ExtendedProductInformation MaintenanceType="A" EXPICode="LIF">2</ExtendedProductInformation>
<ExtendedProductInformation MaintenanceType="A" EXPICode="MSR">N</ExtendedProductInformation>
<ExtendedProductInformation MaintenanceType="A" EXPICode="NPC">A</ExtendedProductInformation>
<ExtendedProductInformation MaintenanceType="A" EXPICode="REM">N</ExtendedProductInformation>
<ExtendedProductInformation MaintenanceType="A" EXPICode="TAX">Y</ExtendedProductInformation>
</ExtendedInformation>
<ProductAttributes>
<ProductAttribute MaintenanceType="A" PADBAttribute="N" AttributeID="Meets or Exceeds Original Equipment Manufacture Specifications">Yes</ProductAttribute>
<ProductAttribute MaintenanceType="A" PADBAttribute="N" AttributeID="Universal Or Specific Fit">Specific</ProductAttribute>
<ProductAttribute MaintenanceType="A" PADBAttribute="N" AttributeID="Type">Gear Drive</ProductAttribute>
<ProductAttribute MaintenanceType="A" PADBAttribute="N" AttributeID="Keyway Adjustable">No</ProductAttribute>
<ProductAttribute MaintenanceType="A" PADBAttribute="N" AttributeID="Chain Included">N/A</ProductAttribute>
</ProductAttributes>
<Packages>
<Package MaintenanceType="A">
<PackageLevelGTIN>00750385002495</PackageLevelGTIN>
<PackageBarCodeCharacters>75038500249</PackageBarCodeCharacters>
<PackageUOM>EA</PackageUOM>
<QuantityofEaches>1</QuantityofEaches>
<Dimensions UOM="IN">
<Height>3.13</Height>
<Width>8.25</Width>
<Length>9.0</Length>
</Dimensions>
<Weights UOM="PG">
<Weight>3.92</Weight>
</Weights>
</Package>
</Packages>
<PartInterchangeInfo>
<PartInterchange MaintenanceType="A">
<TypeCode>O</TypeCode>
<BrandAAIAID>CNWR</BrandAAIAID>
<PartNumber>D4ZZ6306A</PartNumber>
<QualityGradeLevel>S</QualityGradeLevel>
<InternalNotes>X</InternalNotes>
</PartInterchange>
<PartInterchange MaintenanceType="A">
<TypeCode>S</TypeCode>
<BrandAAIAID>FPJN</BrandAAIAID>
<PartNumber>82760SA</PartNumber>
</PartInterchange>
</PartInterchangeInfo>
<DigitalAssets>
<DigitalFileInformation MaintenanceType="A" LanguageCode="EN">
<FileName>2760SA.jpg</FileName>
<AssetType>P01</AssetType>
<FileType>JPG</FileType>
<Representation>A</Representation>
<Resolution>300</Resolution>
<OrientationView>FRO</OrientationView>
<AssetDimensions UOM="PX">
<AssetHeight>1500</AssetHeight>
<AssetWidth>1500</AssetWidth>
</AssetDimensions>
</DigitalFileInformation>
</DigitalAssets>
</Item>

So I am trying to use the first description as my category path (see screenshot attached). but what get's imported is the sentence I am using for description - so my categories are crazy! How can I access only the one I want?
Accepted Answer
Accepted Answer Pending Moderation
Hello,
On the HTML, I was meaning can you add HTML that is not in the file, and wrap certain fields with it so they lay out better when you import them. Sort of like using CONCAT in excel.

You can use CSVI Multi replace rule to add your HTML. You can do that by selecting Add before value or Add after value in Operation field and set the needed HTML in value field. Save the rule and apply it on the field you want the HTML to be added in CSVI template fields. Let me know if that helps.
Kind regards,

Tharuna

=========================
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. # Permalink
Accepted Answer Pending Moderation
Hello,
So I am trying to use the first description as my category path (see screenshot attached). but what get's imported is the sentence I am using for description - so my categories are crazy! How can I access only the one I want?

As per your XML first Descriptions/Description has value Engine Timing Gear Set. Is that what you want as category value? Can you post your import debug log and template XML file to check? Have a look at How to get debug information? document for debug log. To get the template XML file go to CSVI maintenance menu, select CSVI Pro in first option and Backup templates in second option. Select your import template and click continue. Post the downloaded XML file.
Kind regards,

Tharuna

=========================
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
Thank you! I have attached the files. Yes, I want to use that field as part of the category. Now that I look at it again, it might be cool to be able to use the last "sho" field for that too, so I could have Gear Sets and a sub-category for engine timing gear sets.

Also, is there a way to script it to put the fields in proper case? I can't edit the file, because it's received from the company each week and run by cron. Also, can we use any HTML in the lines, for example to combine fields for example the number of teeth, and lines like that and separate them in a paragraph or with a line break from the main product description?
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello,
Thank you! I have attached the files. Yes, I want to use that field as part of the category. Now that I look at it again, it might be cool to be able to use the last "sho" field for that too, so I could have Gear Sets and a sub-category for engine timing gear sets.

Can you also post the template XML file as requested? Your debug log shows the category is checked as GEAR SET "Check if category path exists: GEAR SET". Is that what you need? Can you explain more on the issue you see with your category?

You can combine two fields using CSVI combine rule plugin. You can create a combine field for the node with value "sho" and combine it with category_path field.

Also, is there a way to script it to put the fields in proper case? I can't edit the file, because it's received from the company each week and run by cron.

You can use CSVI Multi replace plugin and using regex you can change the format of field values.

Also, can we use any HTML in the lines, for example to combine fields for example the number of teeth, and lines like that and separate them in a paragraph or with a line break from the main product description?

If you talking about product_desc field then yes you can use HTML in the lines.
Kind regards,

Tharuna

=========================
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
Hello!

I did post the template file. It is the other zipped file attached above. I had to zip it because it was too big to upload.
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello,
The zip file your posted had only the debug log and not the template XML file. And the debug log which was posted separately is empty.
Kind regards,

Tharuna

=========================
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 Tharuna,

They are just HUGE files ... you have to walk away and come back later and they will have loaded. BUT, we switched to CSV and we are having better luck. Thanks for the tip on how to change the case. That's awesome! I'll have to use that in the CSV files too. On the HTML, I was meaning can you add HTML that is not in the file, and wrap certain fields with it so they lay out better when you import them. Sort of like using CONCAT in excel.
  1. more than a month ago
  2. RO CSVI
  3. # 6
  • Page :
  • 1


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