Re: Custom Extra Product Fields lose date when updated in admin
I thought that my custom fields were working perfectly, then I later noticed that any product that I updated through admin lost the values in the custom fields.
For example, one field that I have is products_width, and for product id X products_length has a value of 9.9. I click edit, preview, update (with or without changing ANY value, such as adjusting quantity) and ALL 7 of my extra fields lose the values that were in them (all values for the regular fields are fine).
I can upload them through Easy Populate to restore the values, but I really, really need to be able to do it through admin for all the tiny minor updates.
I looked at my collect_info.php, preview_info.php and update_product.php files and cannot see any problem...
CUT CUT STOP***
I found the problem within the update_product.php file. I had:
'products_length' => $products_length,
because I copied the format from:
'products_weight' => $products_weight,
'products_price' => $products_price,
and now changed it to:
'products_length' => zen_db_prepare_input($_POST['products_length']),
WHY WHEN I copy the line of code from weight, just like price, and modify it to my new field does it loses the value when I update through admin, but price does not?
?
Zen Cart 1.5.3, Database Patch Level: 1.5.3
Server OS: Linux 2.6.32, Database: MySQL 5.5.41
HTTP Server: Apache, PHP Version: 5.4.37