Page 1 of 1

Plugin Development

Posted: Wed Aug 11, 2010 7:58 am
by sweeperq
When people do plugins for their stores, are you utilizing the Custom Fields table, or are you creating new fields/tables in the database?

Re: Plugin Development

Posted: Wed Aug 11, 2010 8:01 am
by igavemybest
It depends whats going on. For a lot of the things I do I create new tables.

Re: Plugin Development

Posted: Thu Aug 12, 2010 3:35 am
by mazhar
You can go with either way. In case of CustomFields you already have dataaccess support in API so you can use it to save/load data to/from this table. In order to create Dataaccess code for custom tables have a look a this thread viewtopic.php?f=47&t=9530

Re: Plugin Development

Posted: Thu Aug 12, 2010 7:00 am
by jmestep
For the products, we go with template fields a lot. There is already a user interface and you can apply more than one template to a product. For example, on one site we have 4 templates on products and have created a conlib to pull the content for just one template so we can separate them into different positions on the product page.
We have used it for a compare product feature-if you go to the following site and check some products, then click compare, most of the fields on the next screen are template fields.

Re: Plugin Development

Posted: Thu Aug 12, 2010 9:47 am
by AbleMods
Template Fields if you want the info by product and a user interface already built. But the fields have the be the same for every product assigned to the same template.

Product Custom Fields if you want different fields for different products. I use this alot because I already have my own interface written to easily manage custom fields on the edit-product page.

There is a third, Custom Fields table which is a generic foreign-key relations table that works for any two tables that unique integer key Id fields. I've never used it and it has no user interface associated with it.