1. roderic
  2. RO CSVI
  3. Thursday, 25 February 2021
  4.  Subscribe via email
Hello,

I am trying to import XML files from VendIT into Virtuemart. I'm struggling with it as these XML files Vendit offers, don't seem to suit CSVI. Could you please tell me if it is even possible with the attached XML files? The hierarchy makes it that it only imports the first item.. For example, in the groups.xml one, it will only import the "Bikes" category and not the ones in the subgroups. Is there a workaround?

Groups = categories.

Joomla 3.9.24
CSVI: 7.20.0
Attachments (2)
Accepted Answer Pending Moderation
Hoi Roland,

In the meantime I've been working on importing/exporting other things from Vendit in trying to get this project to an end.


  1. Category import
  2. Parent Product Import
  3. Child Products import
  4. Stock import
  5. VirtueMart Userinfo Import
  6. VirtueMart Userinfo Export
  7. Order export


1. For this I'm waiting for your update, any estimate?

2. I made a template to import the (parent) products, used combine rules to make sure all the images are imported. I also tried importing the custom fields and ran into a few problems there.
rolandd-custom-param.jpg

It looks good in this preview, but it will only import the first color out of 3 and put an "|" behind it. (I also tried to import it like #ffffff|#ffffff|#ffffff and #ffffff/#ffffff/#ffffff)

rolandd-custom-database.jpg

Also, the label is left empty, I don't think the Documentation covers this part.

3. I've duplicated the Product import and changed the node to


<Products><Product><ProductVariations><ProductVariation>


This will list all the 204 product variants currently in the Products.xml. But the problem is, there is no way to tell which child/variant belongs to which parent. So I guess that's not the way to go. I hope that the changes you are working on for Groups.xml, will also help me in getting (all) the other product import template. Or should I still import the parents first and make a separate template for child products? I want to make use of the breakdesigns Stockable + Customfields for all.

4. Works, I've set up a cronjob that updates the stock for the products that are currently imported for every few hours.

5. Works, I've set up a cronjob that imports new clients every day and they are also automatically imported to AcyMailing

6. Made a template with all the required fields by Vendit. One of them is:

<ImportInfo>
<ExportDateTime> </ExportDateTime>
</ImportInfo>


In the XML Header. Is there a way to generate this date/time?

Also, would there be a way to limit the userinfo's getting exported to users that have placed an order in the last 2 days only?
Maybe a skip rule like this?
rollandd-regex.jpg
And then add that to last visit date or so..

7. Same as 6. Also, would it be possible to trigger this Order export when a client has placed an order instead of a cronjob? (Not that important)

Cheers
Attachments (3)
  1. 3 days ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hello Roderic,

Here are my answers:

1. The way XML works I now do have the 3-level categories as shown before. What I have been working on is trying to see if we can also import the 2-level categories in the same run. I will give it till tomorrow otherwise I can send you a patch so you can at least import your categories for now.

2. Colors are imported without the # for the color. The # is used to separate multiple values. To import the multiple colors for a product your field needs to look like ffffff#ffffff#ffffff. The | (pipe symbol) is added in the database for custom fields for all so they know there are multiple values.The customsforall_value_label field is currently not supported for import. As far as I can see this is not used for the colors.

3.
But the problem is, there is no way to tell which child/variant belongs to which parent.
Welcome to the world of XML :) I do believe this should also be handled by the code I am working on now. Can you send me a new product file? The one posted in your opening post is invalid XML due to wrong closing tags.

4. Nice

5. Nice

6. We have a filter on the Order export for last order date or last modified date. You can filter your orders on that. Assuming you are running this as a cronjob you can use these fields in your cron command. The date can then be filled with the bash date command.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. 2 days ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Good morning,

1. Sounds good

2. You can add labels here:
rollandd-colors.jpg
In the database it then looks like:
rollandd-colors2.jpg
In the frontend it will show up in the module:
rollandd-colors3.jpg

So it is used, although it's not the biggest deal when it's left empty.

3. Attached are the most recent products.xml and the most recent import template. Also the docs I got from Vendit (Could be helpful, maybe).

6. And how about this question? "In the XML Header. Is there a way to generate this date/time?" what code should I put there so it will always put the correct date there?

Cheers!
Attachments (8)
  1. 2 days ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hello Roderic,

Oh 6 got mixed up in 7 :D

In the XML Header. Is there a way to generate this date/time?
You can add a field called custom to your export fields and assign a rule of the type Mutli-replace. This rule will then set a default value that is used in export. In the rule you choose the Date option so that will generate a date with the format you specify. You can then use this field in your XML output.

Let me know if that helps.
Kind regards,

RolandD

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

Thanks for your reply, I have played around with it and figured out it will only work in the Body part of the XML and I need to have it in the Header.
When I use the same tag in the header, it will just show the name of the tag instead.

So, when tag placed in header:


<ImportInfo>
<ExportDateTime>[datetime]</ExportDateTime>
</ImportInfo>


When placed in Body:

<Customers>
<ExportDateTime2>2021-Apr-TueUTC02:04:05+01:00</ExportDateTime2>
<Customer>
  1. 2 days ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hello Roderic,

I did not realize that the header is just output as-is but makes sense as in the header you generally have no information that comes out of any of the fields. We haven't had such a request before I can add this option and send it to you. Which export website are you using? Is the the custom option?
Kind regards,

RolandD

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

Yes I am using the custom option.

roland-xml-header.jpg

roland-xml-header2.jpg


While I'm waiting for your Patch or update for the Categories/Groups, I've tried to get the Customfields part ready of the Products import.
According to the documentation, I need to have a field with custom_multiple with the same amount of Y as there are child products.

Since there is no Y value in the XML file, I thought of a possible workaround. I combined another field called ProductVariations/ProductVariation/IsMandatoryExtra which always has the value False

roland-product-custom3.jpg

Then it will show up like this:

roland-product-custom.jpg

Then I've used Conditional rule to replace the False with Y

roland-product-custom2.jpg

And it will look like:

roland-product-custom4.jpg


Is this the way to do it or am I overcomplicating it?
Attachments (6)
  1. 1 day ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hello Roderic,

Attached is a patch file that you can load and after that the [datetime] placeholder is availabe. This uses the date format as defined in the template settings.

As for your custom_multiple that is one way to do it. Another way is to leave the Your field empty, so not map it to your XML file but set a default value of Y~ and as many times as can appear in your file. So let's say you have a maximum of 5, just add 5 Y-s in there. We do not check on the amount of entries here so if you add the maximum amount you should be good.
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. 1 day ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hoi Roland,

Thanks for the patch, installed and it worked. Although it didn't listen to the time settings I've set in the rule but instead it listens the the Date format on the File tab. I've set it to Y-m-d\TH:i:sP and now it is correct.


No patch for the Categories yet?


I've now managed to import Stockable products + Parent's product's Size and Color. The problem now is that the ID of the 2nd/3rd etc. Stockable product get's the same ID as the parent. Meaning it will not help to make a child import. Also, I tried using skip in the child template so it will take the second child's Size and Colour. But as soon as I use the skip fields, the other rules stop working. For example, I've made a rule that makes a color code from text, these stop working when I use skip fields.

So I'm hoping that your fix for categories will also bring something for child products.

Basically all I would need now for the child products import, is an extra rule/field in the main product template that copies the ID's of the child products to the Stockable fields. Just like it does with color/size. I feel like I'm almost there but just a few small things stopping me from finalizing this..


This missing ID in Stockable:
roland-product-customid.jpg



What If those could be fetched from here:
roland-product-customid2.jpg


I could then run a child template to add the Size and Color (or any other value) because I can then update the child products based on SKU/ID


Cheers!


Edit: added 2 images
Attachments (2)
  1. 1 day ago
  2. RO CSVI
  3. # 9
  • Page :
  • 1
  • 2


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