Page 1 of 1

Product Custom Fields Best Practices

Posted: Tue Sep 07, 2010 2:02 pm
by vn2479
Hello everyone:

Hope everyone had a long, restful weekend.

I have read many posts on here about creating product custom fields, but since I have minimal experience with AC and .NET I'm hoping someone would kindly hold my hand through this process.

Most of our products are fine using the AC product template without modification; however, we have some products that have required fields such as Minimum Quantity Order and Price Per Each Unit. These items are small parts that have several options sold in bulk. I tried the Minimum Quantity field in the Inventory Section on the Edit Product page (Admin) - not quite what we're looking for.

On our old e-commerce site we have a drop down menu with all the options for a specific product. Depending on what option the user chooses the Minimum Quantity Order input box and Price Per Each Unit input box change to reflect the new price or quantity. I would like to keep this same functionality once we convert to AC.

I think the best route for us is to use the custom fields instead of the product template since we have several hundred items with custom fields.

Questions:
- Would I need to create a new table for the custom fields in SQL or just add the custom fields (Min Quantity Order and Price Per Each Unit) in ~/Admin/Products/EditProduct.aspx file?
- If I add the custom fields in EditProduct.aspx would the fields automagically be created in the SQL database? Also, would the newly created custom fields show up in the Admin user interface (important for non-techie staff for updates)?
- Haven't worked much with SQL, DAL, so where do I create/upload the custom field table if this is what I need to do?

Thank you!

Re: Product Custom Fields Best Practices

Posted: Wed Sep 08, 2010 6:58 am
by jmestep
If the minimum quantities determine the per unit price, you could set it up like this:
Set a minimum quantity on the product for the absolute minimum anyone could buy.
Set up a volume discount on the product where the price break is for different levels of quantities.
Customfield vs template may or may not help you. With a customfield, it might be faster for page load because it is in a table with a direct join to the product table rather than nested a couple of tables down.
On the edit product page, you would have to add code to display and save the custom field - the table is already in the database - ac_ProductCustomFields. For the template fields, you don't have to create an interface.
I don't know that customfields would be a benefit if you have different levels of minimum quantities - that is where the volume discounts would help.

Re: Product Custom Fields Best Practices

Posted: Wed Sep 08, 2010 2:31 pm
by vn2479
Hey Judy,

OK, let me see if I understood you correctly. ac_ProductCustomFields is the table where I add all my "custom field" columns (i.e. Price Per Each, Minimum Quantity Order, etc) even if the custom fields don't apply to products (i.e. is there an ac_CustomerCustomFields table)?

So, I need to do two things:

1. Edit the product page to display/save custom fields
2. Create the new columns in the ac_ProductCustomFields table

Once I complete these two steps the new custom fields will automatically display in the admin panel --> edit product?

Thanks again!

Re: Product Custom Fields Best Practices

Posted: Thu Sep 09, 2010 7:38 am
by jmestep
There is an ac_ProductCustomFields table, which applies to products only.
There is an ac_CustomFields table that can be used for any object.
You don't add fields to either table. The relationship in the product custom fields table is determined by the product id. Then you add data into the FieldName and FieldValue fields.
(See Image)
Then you add code to save/edit the custom fields or display them to the appropriate controls.
ProductCustomFields.png

Re: Product Custom Fields Best Practices

Posted: Sat Sep 11, 2010 10:23 pm
by AbleMods
Have you read this yet?

viewtopic.php?f=47&t=12056

Re: Product Custom Fields Best Practices

Posted: Tue Sep 14, 2010 11:26 am
by vn2479
No, I have not read the post. Thank you all for pointing me in the right direction.