1. kmeyer
  2. RO CSVI
  3. Wednesday, 04 February 2015
  4.  Subscribe via email
I am using Joomla 3.3.6 and VM 3.0.4, I need to import about 200 users and set both their Joomla User Group and their VM Shopper Group. I thought this would be fairly straightforward, but I can't even get to first base. I have exported users and I can see the layout of the exported CSV file, but I don't understand how to map my csv file to an import template, and how to add the User Group and Shopper Group data--could you please explain how to set up the import template to accomplish this?
Accepted Answer Pending Moderation
OK, I figured out how to import users. A couple of questions: I can IMPORT the Joomla usergroup_name, but when I EXPORT the same field, it gives me an error:
" <title>Error: 1054 Unknown column &#039;usergroup_name&#039; in &#039;field list&#039; SQL=SELECT `usergroup_name`"
FROM `k2t_usergroups`
LEFT JOIN `k2t_user_usergroup_map` ON `k2t_user_usergroup_map`.`group_id` = `k2t_usergroups`.`id`
WHERE `user_id` = 206</title>

Why can I import this field but not export it?

Second question: My user list has 2-letter State abbreviations, I can export the State field this way (as state_2_code) but it seems I need to use the full state names to import the State data, is there any way around this? Seems crazy to me to have to build a state code translation table to massage my data before importing it.
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
I notice that the first user in my list is being added with the display name "userinfoimport", I tried deleting all the imported users and re-importing them in a different order, and the first one again was added with display name "userinfoimport". Is this a known bug or am I doing something wrong?
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello,

Let me group your questions into one post.

I thought this would be fairly straightforward, but I can't even get to first base.
Did you see the Import VirtueMart 2 users guide?

Why can I import this field but not export it?
That is because of a bug but if you load the attached patch file, that will fix the issue.

I can export the State field this way (as state_2_code)
Actually you can export the state field in 3 different ways:
  • state_2_code
  • state_3_code
  • state_name

Seems crazy to me to have to build a state code translation table to massage my data before importing it.
So you don't have to if you import the state_name field either alone or in combination with the state_2_code field.

and the first one again was added with display name "userinfoimport". Is this a known bug or am I doing something wrong?
I was quite sure that was fixed. So I checked it, and it works OK when you have the name field in your import but if it is not, then it goes wrong. The attached patch fixes that as well.

Let me know if there is anything else I can help you with.
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Thank you, I've applied the patch, but I'm a little confused about the state issue. Are you saying if I import both fields, state_2_code and state, where only state_2_code has a value and state is blank, then it will update the state correctly in the user address?

I tried to add a state_2_code field in my import template, but it isn't available as one of the fields in the Field Name drop-down. Also, I'd like to insert this field next to the state field, but is there a simple way to change the order of the fields, without editing each one to change the order number? I wonder also whether I can leave the Column Header entry blank in the export template, will the Field Name value get plugged in by default, or do I have to manually type in the field name for all of these fields?

Thanks for the support.
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello,

Are you saying if I import both fields, state_2_code and state, where only state_2_code has a value and state is blank, then it will update the state correctly in the user address?
What I mean is that both fields can be in your import file but the state_name has to be filled. To help you out I have attached another patch, after you load this patch go to Available Fields and click on the Update button. This makes the state_2_code available for the user import. So you can use just that field and don't need to worry about the state_name field.

Also, I'd like to insert this field next to the state field, but is there a simple way to change the order of the fields, without editing each one to change the order number?
You can change the number in the box before the field names, after that click the Save button in the toolbar on the right. Not the button at the top of the inputboxes ;)

I wonder also whether I can leave the Column Header entry blank in the export template, will the Field Name value get plugged in by default, or do I have to manually type in the field name for all of these fields?
You can leave the Column Header entry blank, the Field Name will then be used. The Column Header can be used in case you need different names.
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hello, I'm impressed with your quick support. Still having problems I'm afraid. I added the state_2_code patch, ran Update in Available Fields, but I still see state_2_code only in the export template, not if I am in an import template. I tried clearing caches, etc., and tried adding the patch and updating fields twice to make sure.

One additional question--some of my zipcodes start with 0, they are being imported without the leading zero, which makes them look funny in the address display, is there a simple solution for this?

Thank you!
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello,

but I still see state_2_code only in the export template
That is odd, I double-checked the file before posting and just downloaded the patch and I see the file there for the user info import for VirtueMart. If you go to the Available Fields page and filter on VirtueMart and User info import, do you see it there? If not, try to run the Update from there again. I see no reason why it isn't there.

One additional question--some of my zipcodes start with 0, they are being imported without the leading zero, which makes them look funny in the address display, is there a simple solution for this?
Did you open the CSV file with a spreadsheet before importing? That is usually the problem, see my answer here.
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
I'm sorry to keep asking, but still not working. The state_2_code field is NOT there when I check Available Fields, filtering on Import/Virtuemart/User info import, I even tried adding "st" in the 4th filter box in case it wasn't alphabetical for some reason, but it is not there, even after running Update again.

I looked in ...\administrator\components\com_csvi\install and I see two files that I think might be your patches, named com_virtuemart.sql and com_virtuemart.sql.20150204-221954, I see state_2_code for VirtueMart Userinfo Import around line 162 in both those files, but when I look in the availablefields subfolder of that path, the file com_virtuemart.sql does NOT have that code, could it be that the patches are installing to the wrong folder?

As for Zipcodes, I am creating the CSV files by saving a subset from an excel spreadsheet, I don't know how to style the Zip as '00000' and have it stick in the CSV file, any suggestions?

Thanks again.
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
I added the state_2_code line in ...\administrator\components\com_csvi\install\availablefields\com_virtuemart.sql and it shows up now so I can import it. Is this a sufficient resolution, or do I need to use an official patch from you? I had a succesful import, except for Zip leading zeros.
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Is this a sufficient resolution, or do I need to use an official patch from you?
That is sufficient, I see that the file is in the wrong folder in the patch. It will be in the right location when the new release comes out.

As for Zipcodes, I am creating the CSV files by saving a subset from an excel spreadsheet, I don't know how to style the Zip as '00000' and have it stick in the CSV file, any suggestions?
Spreadsheets work with numbers and a number starting with leading zeroes like 01234 is the same as 1234, that is why spreadsheets remove them. So you have to tell the spreadsheet it is not a number but text. In Excel you can do that by adding a single quote before the value. So your zipcode looks like this '01234 and that will keep your leading zeroes.
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Hello again... yesterday I was working in a development test site, so this morning I thought I'd do what I'd learned yesterday on my real site. Now I'm really pulling my hair out. I repeated all the steps--installed csvi, added both patches, copied the state_2_code line to the AvailableFields\com_virtuemart.sql file, ran Update Available Fields. Now I see state_2_code in the available fields, but the available fields list has shrunk to only 9 items, see the attached screen shot.

I've tried this a couple times. Sometimes I get an error when I run Update Available Fields, it says "SQL=0" or something like that. Do I need to back out my CSVI installation completely before re-installing it? If so, how do I do that?
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 11
Accepted Answer Pending Moderation
I started from scratch after restoring from a backup. I don't know what I did differently but it seems to be working now.
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hello,

Someone suggested in another forum post it might be the night ghosts :) I guess it happens.

Do you want me to post an updated patch with the file in the correct location?
  1. more than a month ago
  2. RO CSVI
  3. # 13
Accepted Answer Pending Moderation
Thanks, not necessary.
  1. more than a month ago
  2. RO CSVI
  3. # 14
  • Page :
  • 1


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