Displaying Custom Fields
Once you have finished adding a field to the database, you will need to figure out where you want to display it, and write the code to do that. Here are some guidelines.
Case 1: New field in products table
a) Adding the new field to the product_info page:
includes/modules/pages/product_info/main_template_vars.phpto retrieve the field and create a variable to store it.
includes/templates/YOURTEMPLATE/templates/tpl_product_info_display.phpto show the variable.
b) Adding the new field to the product listing page:
includes/modules/pages/index/main_template_vars.phpto retrieve the new field.
includes/modules/YOURTEMPLATE/product_listing.phpto display the field.
(Some people shortcut this process by skipping the first file and just doing the query in the second file.)
Case 2: New field in orders table
If you add a field to the orders table which is set during order creation, add the field to
includes/classes/order.php in the
Then you can reference it as needed in
On the admin side, you may also wish to reference it in
query() method from
includes/classes/order.php, add it to whatever array makes sense (
delivery), then reference it in any of the files above the same way other fields in that array are referenced.