I personally had to change !empty to !is_null since I sometimes want "0" values to display and the new PHP considers "0" to be the same as empty.
-lindasdd
Printable View
Hi Ajeh
Thanks for all your help.
I got the developers tool kit to work by ensuring that the ADMIN folder was renamed in all the Configure files. I then did what you suggested and compared the "products_technical" with other fields that were working and discovered that a missing letter N was the culprit!!! It is now working well.
Now, on to the problem of invalid master category ID which is appearing on one or two products and not allowingany of the data from the database to show up.
Thanks
Gillian
When trying to add the the info from the product admin page I keep getting a white screen. The boxes are showing up to add my info. When I add it I will click preview. It doesnt show in there and then if I click update it just goes to a white screen.
Can someone help with this?
Thanks,
Keith
Personally, I don't. It makes the code more complex (and hence more error-prone) and leads to poor structure. It also adds more overhead. If the Zen Project team write code that updates tables by using the VALUES (xxx, xxx, xxx, ...) syntax, then they are being silly. Their own code will end up breaking at some time. I suspect they use the much less error-prone "UPDATE table-name set col_x = 'xxxx', col_y = 'xxx' ...". I know I do -- it avoids having to go back and change code when the database schema changes. Note that separating your added columns into a separate table does not avoid this particular problem -- if you add another column to YOUR table, you can still break YOUR code unless you write your code to avoid the problem.
Tables should be kept as normalized as possible.
Guys i have a dumb question, I want to replace the word: "Model" with "Part #" where can i change that?
Thanks
Search for the word Model in the lang. files
tools>Developers Tool Kit > Language File Look-ups:
find the one for that particular output
Ive not seen this issue on a search so will post here in case its happened to someone else,
I have 3 new product fields setup which are all working correctly, but have noticed when trying to Duplicate a Product, the new fields show up as empty.
Can anyone advise what file I need to edit to enter this information to copy over.
Thanks very much
Sam
Does the module copy_to_confirm.php have your new fields in it? :unsure:
Thanks for the reply, ok ive messed about with the code a little on the copy_to_confirm but it is copying strange information over, replacing new field boxes with something completely different... for example I have 3 extra fields, none of the information actually gets copied, it takes it from another field (like model) depending where I place the extra fields this effects another fields data being copied, :wacko:
Any thought, much appreciated, thank you :)Quote:
} elseif ($_POST['copy_as'] == 'duplicate') {
$old_products_id = (int)$products_id;
$product = $db->Execute("select products_otherinfo, products_size, products_weight2, products_type, products_quantity, products_model, products_image,
products_price, products_virtual, products_date_available, products_weight,
products_tax_class_id, manufacturers_id,
products_quantity_order_min, products_quantity_order_units, products_priced_by_attribute,
product_is_free, product_is_call, products_quantity_mixed,
product_is_always_free_shipping, products_qty_box_status, products_quantity_order_max, products_sort_order,
products_price_sorter, master_categories_id
from " . TABLE_PRODUCTS . "
where products_id = '" . (int)$products_id . "'");
$tmp_value = zen_db_input($product->fields['products_quantity']);
$products_quantity = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
$tmp_value = zen_db_input($product->fields['products_price']);
$products_price = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
$tmp_value = zen_db_input($product->fields['products_weight']);
$products_weight = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
$db->Execute("insert into " . TABLE_PRODUCTS . "
(products_otherinfo, products_size, products_weight2, products_type, products_quantity, products_model, products_image,
products_price, products_virtual, products_date_added, products_date_available,
products_weight, products_status, products_tax_class_id,
manufacturers_id,
products_quantity_order_min, products_quantity_order_units, products_priced_by_attribute,
product_is_free, product_is_call, products_quantity_mixed,
product_is_always_free_shipping, products_qty_box_status, products_quantity_order_max, products_sort_order,
products_price_sorter, master_categories_id
)
values ('" . zen_db_input($product->fields['products_type']) . "',
'" . $products_quantity . "',
'" . zen_db_input($product->fields['products_otherinfo']) . "',
'" . zen_db_input($product->fields['products_size']) . "',
'" . zen_db_input($product->fields['products_weight2']) . "',
'" . zen_db_input($product->fields['products_model']) . "',
'" . zen_db_input($product->fields['products_image']) . "',
'" . $products_price . "',
'" . zen_db_input($product->fields['products_virtual']) . "',
now(),
'" . (zen_not_null(zen_db_input($product->fields['products_date_available'])) ? zen_db_input($product->fields['products_date_available']) : '0001-01-01 00:00:00') . "',
'" . $products_weight . "', '0',
'" . (int)$product->fields['products_tax_class_id'] . "',
'" . (int)$product->fields['manufacturers_id'] . "',
'" . zen_db_input($product->fields['products_quantity_order_min']) . "',
'" . zen_db_input($product->fields['products_quantity_order_units']) . "',
'" . zen_db_input($product->fields['products_priced_by_attribute']) . "',
'" . (int)$product->fields['product_is_free'] . "',
'" . (int)$product->fields['product_is_call'] . "',
'" . (int)$product->fields['products_quantity_mixed'] . "',
'" . zen_db_input($product->fields['product_is_always_free_shipping']) . "',
'" . zen_db_input($product->fields['products_qty_box_status']) . "',
'" . zen_db_input($product->fields['products_quantity_order_max']) . "',
'" . zen_db_input($product->fields['products_sort_order']) . "',
'" . zen_db_input($product->fields['products_price_sorter']) . "',
'" . zen_db_input($categories_id) .
"')");
You are just sticking the new fields where ever ...
Put them on the end of the originals so that you are keeping everything in order ...