Adding Custom Fields For Customer

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
mbartens
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 107
Joined: Mon Mar 09, 2015 3:34 am

Adding Custom Fields For Customer

Post by mbartens » Tue Mar 10, 2015 4:14 am

I'm creating a site that allows people to purchase subscriptions to the site which will give them member discounts.
When they subscribe I need to collect some information that I can query later. Adding product options isn't enough.
What is the best way to go about this? Will I be using the ac_CustomFields table? Thanks!!
May

User avatar
david-ebt
Captain (CAPT)
Captain (CAPT)
Posts: 253
Joined: Fri Dec 31, 2010 10:12 am

Re: Adding Custom Fields For Customer

Post by david-ebt » Tue Mar 10, 2015 6:23 am

You can also use the ac_UserSettings table. It can store FieldName and FieldValue pairs of data for users.

You use

Code: Select all

string ValueToGet = AbleContext.Current.User.Settings.GetValueByKey("FieldToGet")
to get the value for a user.

And you use

Code: Select all

AbleContext.Current.User.Settings.SetValueByKey("FieldToSave", "ValueToSave")
to save the value for a user.

I hope that gets you pointed in the right direction.
David
http://www.ecombuildertoday.com
Enhanced Reporting for AbleCommerce
Image

mbartens
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 107
Joined: Mon Mar 09, 2015 3:34 am

Re: Adding Custom Fields For Customer

Post by mbartens » Tue Mar 10, 2015 8:58 am

Haven't tried saving yet but displaying is working great! Thank you for your help!
May

Post Reply