Adding our own fields to a table, sales receipt

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Adding our own fields to a table, sales receipt

Post by Brewhaus » Mon Oct 18, 2010 1:24 pm

In order to help track sales to specific customers (or more accurately, to allow our export / import software to properly attribute sales to the correct sales rep) we would like to add one or two fields to the Users table (actually, it likely needs to be added to the Addresses table). Then, we would need this to be used as part of the information included with each sale (although we would not include it on the printed invoice).

If we add fields to the Addresses table, will we start having problems? Or, will adding a couple of fields have no real effect on the operation of our site?

And, if we are able to add the fields with no negative effect, are we able to include it in the information assembled for the order without having it display on the invoice? From there we should easily be able to export and import, as we already have a custom written exporter that exports our end of day for importing into our accounting package, and can easily route the information correctly.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

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

Re: Adding our own fields to a table, sales receipt

Post by mazhar » Tue Oct 19, 2010 4:40 am

You can't add custom fields in tables them selves because in this case API code will not be aware of such fields so system will not load/save values in those fields for you. If you want to have a custom field in Address table then instead of creating new column use existing NickName column which is unused for now. If you need more then one fields then you can try user settings features.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Adding our own fields to a table, sales receipt

Post by jmestep » Tue Oct 19, 2010 6:43 am

You can add fields, but you would need to create code to handle them and they might break an upgrade later on. When we have run into a case like that, we have added entries to the ac_UserSettings table then migrated the content over to the ac_CustomFields table with a tablename of ac_Orders from code on the ReceiptPage. There is code on the forum to show you how to pull the data out of the ac_CustomFields table.
We do it on the receipt page because the one page checkout is very complicated and custom things get lost in postbacks unless they are after the shipping address shows and sometimes customers want the input to show before that. We have fooled for hours and hours with the one page checkout it's a lot easier to circumvent it instead of try to coordinate with it.
You also need to add code on the one page checkout to migrate the user settings when the user is migrated because in older versions, Able didn't do that. I haven't checked 705 to see if they do it yet.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: Adding our own fields to a table, sales receipt

Post by Brewhaus » Tue Oct 19, 2010 7:18 am

I think that I understand what you are saying- we need to use ac_UserSettings and ac_CustomFields to 'match' a field from ac_Orders (for example, the company name). If the company name matches, then a field in ac_CustomFields is included in the receipt. Is that correct? If so that is great... I just don't know how to go about this.

Just to confirm- we do not need the 'custom' information to show on the receipt. We just need it to be part of the stored information for the order so that when we export the order information (with our custom exporter that you helped write) this custom information is included.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

Post Reply