How to write custom CSV import routine
How to write custom CSV import routine
You can write your own import routines to import the CSV data directly from the admin pages. I thought it would be helpful for the community to have some sample of custom CSV import routine. This sample is about how to import users from a CSV file. This is just a sample and provides a basic over view of the user import. It will only import the data for fields that are available with user object. For example the First and last name fields are available in address class so it will not import that information. Obviously that could be done but that will be a complected task and it would be better to keep the sample simple. The sample targets advance users who may want to import their custom CSV information.
You can download the sample from this thread
viewtopic.php?f=47&t=9720
You can download the sample from this thread
viewtopic.php?f=47&t=9720
Re: How to write custom CSV import routine
Hi Mazhar-
We are needing to create some custom process for uploading CSV or XML data received from our call center, into the Able Cart. The call center will be taking phone orders for one or more products of our products using their call system, not our cart. At the end of each day, we will get a file from them (the call center) and will we need to upload the data into our system. This is essentially the customer info, what they are ordering, and the payment information. Your solution of uploading directly from the admin pages is great, but I'm still not sure how to handle the CC info. Do you have any recommendations?
We are needing to create some custom process for uploading CSV or XML data received from our call center, into the Able Cart. The call center will be taking phone orders for one or more products of our products using their call system, not our cart. At the end of each day, we will get a file from them (the call center) and will we need to upload the data into our system. This is essentially the customer info, what they are ordering, and the payment information. Your solution of uploading directly from the admin pages is great, but I'm still not sure how to handle the CC info. Do you have any recommendations?
Re: How to write custom CSV import routine
In fact after reading the CSV headers you need to use the AbleCommerce objects to import that data. So if you are trying to import some order then it means you have to put some code to map CSV fields on order object and import them. For example check the following thread where credit card information is imported for orders
viewtopic.php?f=42&t=9839
viewtopic.php?f=42&t=9839
Re: How to write custom CSV import routine
Hi Mazhar in your sample application to import User details how to import FirstName and LastName fields? as you said "..First and last name fields are available in address class so it will not import that information." because our ultimate goal is to import Order details but we are facing some issues not sure values for what all fields we shall give in CSV? if we give fields for all columns then will it automatically consider them as collection? like if we give values of all required fields of Payment then will it consider it as Orders Payments details? it means I am talking about your code.
Can you please tell us what all columns we shall if we want to import Order details?
any help will be highly appreciated.
Thanks,
Niraj Parikh
Can you please tell us what all columns we shall if we want to import Order details?
any help will be highly appreciated.
Thanks,
Niraj Parikh
Re: How to write custom CSV import routine
Read the CSV fields for orders import supported by DataPort form here
http://wiki.ablecommerce.com/index.php/ ... rt_Utility
http://wiki.ablecommerce.com/index.php/ ... rt_Utility
Re: How to write custom CSV import routine
that didn't work, in your case how to set values for First Name and Last Name fields from CSV for User details? as they are not fields of User table.
Re: How to write custom CSV import routine
Set them on User.PrimaryAddress
You can download the API documentation from here
ftp://ftp.ablecommerce.com/evals/Commer ... 7_Help.zip
You can download the API documentation from here
ftp://ftp.ablecommerce.com/evals/Commer ... 7_Help.zip
- robreil
- Captain (CAPT)
- Posts: 340
- Joined: Fri Jun 10, 2005 1:22 pm
- Location: Kennesaw, Ga. USA
- Contact:
Re: How to write custom CSV import routine
As stated in viewtopic.php?f=61&t=9973 I have a Able5.5CFMX cart with MySQL 4.1 DB with some custom fields put in the Products table.
When migrating from 5.5 to 7.x how will I get all of that data migrated into 7.x.
I have extra tables too but they are static and I can do a table back up as csv, and then an import into the database directly as the Cart does not hit those tables yet..
The extra fields are only pulled from when an email is sent via the cart. namely "Our Notification".
Please advise.
When migrating from 5.5 to 7.x how will I get all of that data migrated into 7.x.
I have extra tables too but they are static and I can do a table back up as csv, and then an import into the database directly as the Cart does not hit those tables yet..
The extra fields are only pulled from when an email is sent via the cart. namely "Our Notification".
Please advise.