Zen Cart Logo
Forums / General Questions / Adding a Field to the Products Table - everything working good 'cept one thing

Adding a Field to the Products Table - everything working good 'cept one thing

Views: 505

Results 1 to 2 of 2
3 Jun 2012, 11:08 PM
#1
gotlogos avatar

gotlogos

New Zenner

Join Date:
Nov 2010
Posts:
84
Plugin Contributions:
0

Adding a Field to the Products Table - everything working good 'cept one thing

I have a field I added to my products table. It is onlly for administrative use and won't be used to display on the product info page that the customer sees. I added the field called 'bin' to the products table. Then I was able to successfully create an input field for it, when editing or creating a new product.

I modded the update_product.php and preview_info.php (directions followed from crazy_chris's thread). Not sure what I am doing wrong but when I assign a number when I edit products, the database will update, I can see it in myPHP, but when you go back into the product edit screen, no data is displayed and if I then update that page (not touching that field), the information I put in previously into that 'bin' field is erased (I used a varchar data type as sometimes there may be something other than numbers in this field).

I imagine the php file that retrieves the info from the database table and populates that field in the edit product screen is preview_info.php? Does anyone have an idea of what I might be doing wrong to where that input field comes out blank (even though there is data in the table for it) and then if I update the info 'disappears' from the table, as though, when that screen appears for editing, it initializes that field to NULL instead of retrieving the data for it from the table.

Any help would be appreciated. I am sure its somethign fairly simple I am missing.

3 Jun 2012, 11:29 PM
#2
gotlogos avatar

gotlogos

New Zenner

Join Date:
Nov 2010
Posts:
84
Plugin Contributions:
0

Re: Adding a Field to the Products Table - everything working good 'cept one thing

I just fixed it. I forgot to enter p.products_bin to the $parameters array and the $product variable at the top of the collect_info.php file...