How to add field in products table and how to search in new field

Adding filed in Zen Cart prodcuts table must be done carefully. Please make sure you have a fullbackup of your website: files and database before proceeding.

From perspective of database to add field is the easyest task. It can be done with no problem and with no fear. You will make no mess because your new added filed wil be just ingnored as long as you did not make changes into the core file system. Do not delete fields, this is BAD.

To add fields in Zen Cart products table and to make ZenCart default search system (admin area and front end area) to search for value in the new added field involve changing in the following files:

Admin area

1. “DEFINE” new field in:
admin/includes/extra_datafiles/group_price_per_item.php

2. Make Zen Cart Search system to look for value in gthat filed in :
admin/includes/modules/category_product_listing.php
How You do it? Look for $products_query_raw and change the query according to your new field. Here you must use field name you added in table and not the name defined above.

3. Make filed to be shown when Zen Cart engine will insert a product. Change the following file.
admin/includes/modules/product/collect_info.php

3. Make filed to be updated when Zen Cart engine will edit (update) a product. Change the following file.
admin/includes/modules/update_product.php

Zen Cart front end (website) area

Here you must change your own files template. Look for product_info template.

—————————————-

This job is pretty complex in case you have other Zen Cart module running on your Zen Cart website. Contact us if you consider. We can solve any issue in ZenCart.