"Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Niraj8428
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Feb 20, 2009 9:13 am

"Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by Niraj8428 » Sat Feb 21, 2009 12:37 am

Hi,

We have one store on “AbleCommerce 7.0” and we have one other application from where we receive orders’ details in form of CSV file, now we don’t want to enter our other application’s orders in to our store on “AbleCommerce 7.0” manually using “Data Port”, then do “AbleCommerce 7.0” has any other option, like exposed web services or any API or something, by calling methods of which we can send and thus save our other application orders data in our “AbleCommerce 7.0” store?

Ultimately we want to automate this data entry task (“Uploading (Importing) AC7 CSV data”) by some windows service application or something like that, so what shall we do?

Has it anything to do with “CommerceBuilder API”?, means does it mean for/match with our this requiremnet?

Any help will be highly appreciated.

Thanks,

Best Regards,
Niraj Parikh (Project Lead)
Cygnet Infotech Pvt. Ltd. - http://www.cygnet-infotech.com

Phone: +91 79 4022 6400
Direct: +91 79 4022 6413

Skype: niraj.parikh
MSN: niraj.parikh AT live.com
Yahoo: niraj.parikh AT yahoo.com

"If you change the way you look at things, things you look at change."
"It's never crowded along the extra mile."
Dr. Wayne Dyer.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by mazhar » Sat Feb 21, 2009 3:16 am

AbleCommerce doesn't expose no such functionality out of the box. I have posted some samples about writing custom CSV import routines and manipulating CSV in AbleCommerce. You can write some of your custom import routine for order CSV and then expose it through some of your custom web service. Please check the following threads

viewtopic.php?f=61&t=9828
viewtopic.php?f=61&t=9829

Niraj8428
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Feb 20, 2009 9:13 am

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by Niraj8428 » Sat Feb 21, 2009 3:39 am

Hi Mazhar thanks for your reply, I have gone through threads you referred, but I think that still needs user interaction, we want to automate the process of data entry in store on Able Commerce.

Thanks,
Niraj.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by mazhar » Sat Feb 21, 2009 3:52 am

Those samples are just to provide you the guide line how you can carry out that job. Obviously you will need to write web services and other necessary components to automate your custom order CSV import process.

Niraj8428
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Feb 20, 2009 9:13 am

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by Niraj8428 » Sat Feb 21, 2009 3:59 am

from where to get using CommerceBuilder.Utilit? I am new with integration with AbleCommerece so no idea from where to get this? can you please help me out? if you can upload a small but complete sample including AC references it uses, then that will help us lot.

Thanks,
Niraj

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by mazhar » Sat Feb 21, 2009 4:04 am

These classes are defined in CommerceBuilder dll which can be found in AbleCommerce installation's bin directory.

Niraj8428
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Feb 20, 2009 9:13 am

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by Niraj8428 » Thu Feb 26, 2009 12:47 am

thanks, finally I am able to use these dlls and able to run the website I created including your page, however need one more favor, any idea how to upload Credit Card information related to orders?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by mazhar » Thu Feb 26, 2009 3:51 am

Here is the modified import sample for importing credit card data.

Niraj8428
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Feb 20, 2009 9:13 am

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by Niraj8428 » Thu Feb 26, 2009 3:59 am

Thanks lot for this. I have created one website and have given reference to all required dlls, but dont know what I need to give in web config to access CommerceBuilder database? can you please give me connection string format and all details what I need to specify in web.config file to support this code or say to access the db?

thanks,
niraj.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by mazhar » Thu Feb 26, 2009 4:03 am

You can provide a connection string in following way in App_Data/database.config

Code: Select all

<connectionStrings>
   <add name="AbleCommerce"
    connectionString="server=yourserver;database=yourdatabase;Integrated Security=true;"
    providerName="System.Data.SqlClient" />
</connectionStrings>

Niraj8428
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Feb 20, 2009 9:13 am

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by Niraj8428 » Thu Feb 26, 2009 4:42 am

hey database.config or web.config doesnt matter where I give this connection string right?
moreover this server and database details means details of our store on AbleCommerce right?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by mazhar » Fri Feb 27, 2009 9:38 am

If you want to execute your custom queries within AbleCommerce pages or boundary then you need not to worry about the connection string. All you need is to access the Database object from Token and makes use of it.

Code: Select all

Microsoft.Practices.EnterpriseLibrary.Data.Database database = Token.Instance.Database;
       string sql = ("SELECT COUNT(*) As RecordCount FROM ac_Affiliates WHERE StoreId = @storeId");
       using (System.Data.Common.DbCommand selectCommand = database.GetSqlStringCommand(sql))
       {
           database.AddInParameter(selectCommand, "@storeId", System.Data.DbType.Int32, Token.Instance.StoreId);
           int affiliateCount = (int)database.ExecuteScalar(selectCommand);
       }

Niraj8428
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Feb 20, 2009 9:13 am

Re: "Uploading (Importing) AC7 CSV data" & “CommerceBuilder API"

Post by Niraj8428 » Mon Mar 16, 2009 3:21 am

I have attached one page where we try to upload data from CSV to database using AC ddl's, we are able to save all other information but Payment, when we try to save payment information, it gives us error that "Object reference not set to an instance of an object" if you can please go through this page and let us know what is missing or are we in wrong direction then we we will be very thankful to you.


Thanks,

Best Regards,
Niraj

Post Reply