I am fairly new to Zen Cart, but I really like it so far.
I almost always need additional data fields for my projects, and I have designing on page the basics of an 'additional product fields' module. I would like some feedback on the design.
One thought is to have a simple table like:
product_additional_fields
- field_name varchar(100)
- field_description varchar(100)
product_additional_field_values
- product_id
- field_name varchar(100)
- field value varchar(200) OR text
The admin tools would let the admin add new fields with a description, then the modules would create basic text fields for these on the 'add product' screen.
The main drawback is that everything is stored as plain text, so you can't really do anything true comparisons or reports. Also, the SQL to get the fields for each product in the product listing is a little bit of a pain, probably easiest to most of the work in PHP.
Another thought is to create a more complex set up, starting with an empty table, and allow the admin user to add fields, choose between text, integer, numberic, and then have the admin module create the necessary 'alter table ' syntax to create the data fields in the additional fields table. Then, the product data would be stored in this table, one row per product. A simple left join in the product listing or product details would pull in the data if it exists.
Can someone that is more familiar with Zen give me some guidance. I think this would be a useful module if built properly.
Also, I don't see anything in the development map, so maybe this is in the works.
Thanks,
B



