Actually I wrote 2009 (webego thread), but I was thinking of 2007 (crazy_chris thread). I decided not to try the numinix, and instead edited files... WITHOUT complete success, but some success. Here is what I did so far:
http://www.zen-cart.com/showthread.p...-your-Products
http://www.zen-cart.com/showthread.p...y-listing-page
THE SHORT LIST:
1.Admin>Tools>Install SQL Patches
ALTER TABLE `products` ADD `products_newfield` TEXT;
2. Edit "/admin/includes/modules/product/collect_info.php".
2a. After "$parameters = array", add to list with others:
'products_newfield' => '',
2b. After "$product = $db->Execute("select"," , add to list with others:
p.products_newfield
2c. Add the input fields in the product-mask, in area with other add:
<tr>
<td class="main"><?php echo TEXT_PRODUCT_NOTES; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_newfield', $pInfo->products_newfield); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
3. Edit "/admin/includes/modules/product/preview_info.php"
After "$product = $db->Execute("select", add to list with others:
p.products_newfield
4. Edit "/admin/includes/modules/update_product.php"
After "$sql_data_array = array(", add to list with others:
'products_newfield' => zen_db_prepare_input($_POST['products_newfield']),
QUESTION QUESTION for #4: Shoud I also add after "// Data-cleaning to prevent MySQL5 data-type mismatch errors:" with the others:
$tmp_value = zen_db_prepare_input($_POST['products_newfield']);
$products_newfield = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
5. Edit "/includes/modules/pages/product_info/main_template_vars.php"
After "$sql = "select", add to list with others:
p.products_newfield
Also added to the list with the others:
$products_newfield = $product_info->fields['products_newfield'];
Then also with the others after "// build show flags from product type layout settings", I added:
$flag_show_product_info_newfield = zen_get_show_product_switch($_GET['products_id'], 'newfield');
6. Edit "/includes/templates/MYTEMPLATE/templates/tpl_product_info_display.php
<?php echo (($flag_show_product_info_newfield == 1) ? '<li>' . $products_notes . TEXT_PRODUCT_NEWFIELD . '</li>' : '') . "\n"; ?>
QUESTION QUESTION #6: The above does not work (I see "(bullet point) 100.101TEXT_PRODUCT_NEWFIELD"), but below does:
<!--bof product newfield -->
<?php if ($products_newfield != '') {
?>
<div class="productGeneral"><li>Newfield:<?php echo $products_newfield; ?></li></div>
<?php
}
?>
<!--eof product newfield -->
Also works:
<?php if (!empty($product_info->fields['products_newfield'])) echo $product_info->fields['products_newfield']; ?>
7. Edit "/includes/languages/english/YOUR_TEMPLATE/index.php"
define('TABLE_HEADING_NEWFIELD', 'Newfield');
8. Edit "/includes/modules/pages/index/main_template_vars.php
(under "// create column list $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,")
'PRODUCT_LIST_NEWFIELD' => PRODUCT_LIST_NEWFIELD,
case 'PRODUCT_LIST_NEWFIELD':
$select_column_list .= 'p.products_newfield, ';
break;
9. Edit "/includes/modules/YOUR_TEMPLATE/product_listing.php", and add:
case 'PRODUCT_LIST_NEWFIELD':
$lc_text = TABLE_HEADING_NEWFIELD;
$lc_align = '';
$zc_col_count_description++;
break;
10. Edit "/includes/index_filters/default_filter.php", and add to "$select_column_list" (4 different times):
p.products_newfield,
case 'PRODUCT_LIST_NEWFIELD':
$listing_sql .= " order by p.products_newfield " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
11. Insert into configuration:
?????????????????????
I messed up my table somehow. Basically what happened is that the thread listed:
insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Display Product Newfield', 'PRODUCT_LIST_NEWFIELD, '4', 'Do you want to display the Product Newfield', 8, 5, now());
BUT, I received an error, so I went into phpmyadmin, exported the configuration table as cvs, opened it in open office, inserted row around 212, copied and pasted similar row and edited it to "newfield", and imported the cvs into phpmyadmin (deleting original during the import).
NOW I SEE THE NEWFIELD IN ADMIN, BUT in admin>configuration>product listing when I click on edit, no text box appears on the right. I can click on update, then the value changes from 3(3 for example) to blank ( for example) for ANY AND ALL in this admin>configuration>product listing area. Here's an example of a row from the cvs file:
212,"Display Product Image","PRODUCT_LIST_IMAGE",1,"Do you want to display the Product Image?",8,1,"2014-07-03 07:51:01","2009-05-30 08:43:46","NULL","NULL"
218,"Display Product Newfield","PRODUCT_LIST_NEWFIELD",3,"Do you want to display the Product Newfield?",8,7,"NULL","2009-05-30 08:43:46","NULL","NULL"
So, that is a BIG problem.
2nd problem, the product listing added the newfield, but like this when nothing is in that field for a product:
0
And like this when the value I entered is MEMEMEM:
MEMEMEM
So, 2nd issue really is to stop showing "0" when empty.
And 3rd problem is that on the individual product page it shows:
MEMEMEMTEXT_PRODUCT_NEWFIELD


Reply With Quote

