Custom database fields

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
mouse_8b
Commander (CMDR)
Commander (CMDR)
Posts: 115
Joined: Mon Oct 11, 2010 1:21 pm
Location: Austin, TX
Contact:

Custom database fields

Post by mouse_8b » Thu Sep 15, 2011 3:20 pm

Hello,
I have some basic knowledge of databases, but I don't have to use them very often, so I'm no expert. If I wanted to collect extra information from customers and store that information in the database, how would I go about doing that? Would it be better to add a new table to the database or to use a pre-existing one? I know there is an ac_CustomFields table, is that what I am looking for? And how do I take information from the page and put it into the database? I'm confident that I can get the ASP.NET and C# components cooperating, but what methods are used to write that data to the database? After some brief searching, I found some tutorials for accessing databases with C#, but I also know that AC already accesses the database, so I was hoping I might be able to piggy-back off of that. I would like to be able to give the customer options in the way they deal with our store and company, but I don't know how to save those preferences.

I'm not really sure where to start on this, any help or direction would be appreciated.

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

Re: Custom database fields

Post by mazhar » Tue Sep 20, 2011 10:02 am

Well the answer to your question depends upon what sort of data you are wanting to collect. If its something simple like a one or two values and are needed for product then perhaps product custom fields should be used. Similarly if you are thinking to collect it for user and one or two value per user then you might consider user settings in ablecommerce for that purpose. Lastly you can make use of ac_CustomFields too. But if its something rather complex then its always better not to modify the existing tables in order keep upgrade path easy. In this case you can add your new table to the database. See following thread about auto generating ablecommerce like data access code for your custom tables viewtopic.php?f=47&t=9530

Post Reply