I tried using this but didn't get the desired results. On further delving I believe the original how-to is mistaken, and I'm not sure why it works for so many others.
I'm not a professional coder but I was able to fix it by replicating the way products_weight is handled. (I am adding height, length and width properties.)
I'm not sure if all the following additions are necessary, but they worked for me. The main problem is that copy_to_confirm.php was not modified in this how-to. All additions based on a property product_height.
1) update_product.php (in /admin/includes/modules/)
a) around line 30, ADD:
Code:
$tmp_value = zen_db_prepare_input($_POST['products_height']);
$products_height = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
b) around line 40 ($sql_data_array = ....), ADD:
Code:
'products_height' => $products_height,
2) copy_to_confirm.php (in /admin/includes/modules/)
a) around line 37 ($product = $db->Execute...) ADD:
b) around line 52 ADD:
Code:
$tmp_value = zen_db_input($product->fields['products_height']);
$products_height = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
c) around line 62 ($db->Execute("insert into " . TABLE_PRODUCTS . "....) ADD:
d) around line 79 (continuation of last statement) ADD
Code:
'" . $products_height . "',
I'm pretty sure these last two need to have the fields in the correct order that they appear in the table.
OK! Now I can enter the new properties and they actually get entered into the database!!!
Bookmarks