Currently all product fields are hard-coded in the product collect_info page, and there is a lot of code duplication for each product type. This is a pain for those people writing mods and need to add extra fields to the page.
Time for a change, and try to make this easier.
After much trial and error, I came to this solution:
[x] Place all the fields in separate files
[x] Use a database table to save which fields are to be shown in a product type
[x] Put new fields in new tables PRODUCTS_EXTRA, and PRODUCTS_EXTRA_DESCRIPTION (multi language fields) Decided not to do this for better compatibility with existing extra fields
[ ] create new fields
[ ] delete fields
[ ] Add product types
[ ] Edit product types
[ ] Remove product types
[x] Add tabs
[x] Edit tabs
[ ] Remove tabs
[x] Load fields in collect info
[x] Load/build database query from fields
[x] Load language defines
Parts of this are based/inspired on the Numinix product fields module.
Currently all product fields are hard-coded in the product collect_info page, and there is a lot of code duplication for each product type. This is a pain for those people writing mods and need to add extra fields to the page.
Time for a change, and try to make this easier.
After much trial and error, I came to this solution:
Put new fields in new tables PRODUCTS_EXTRA, and PRODUCTS_EXTRA_DESCRIPTION (multi language fields)Decided not to do this for better compatibility with existing extra fields