I'm not really sure if this is what you guys were looking for, but my company needed it so why not make my own? So i've done just that, this adds the UPC field to the product_type named product (the generic one). How I went about this was with alot of grep and vi
. I also tried to model the UPC around the model field, as they are relatively close to the same thing. Ok without any further deliberation I shall now unveil the UPC field:
This should be enough to get the UPC field nice and presentable, it can be entered in admin interface, viewed in preview, viewed by customer, and is searchable as well. If there is any request for it (I may do it anyway) I shall make a product type maker, cause I may end up having to make one for my job anyway. I can also make a script for this if anyone asks.Code:MySQL (Zencart DB) PRODUCT_TYPES here lies the product types (templates) PRODUCT_TYPE_LAYOUT this is for configuration of fields GET_TERMS_TO_FILTER only useful for side box selection PRODUCT_TYPES Not useful for adding UPC to Product-General PRODUCT_TYPE_LAYOUT add new row INSERT INTO product_type_layout(configuration_title, configuration_key, configuration_value, configuration_description, product_type_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Show UPC Number', 'SHOW_PRODUCT_INFO_UPC', 1, 'Display Model Number on Product Info 0=off 1=on', 1, 10, now(), now(), NULL, "zen_cfg_select_drop_down(array(array('id'=>'1', 'text'=>'True'), array('id'=>'0', 'text'=>'False')), "); PRODUCTS add new field ALTER TABLE products ADD products_upc VARCHAR(12) DEFAULT(NULL); ./zencart/admin/includes/modules/product this has governing scripts over the general product type collect_info.php * add products_upc => '' to $parameters associative array * add p.products_upc to database query on line 60 apprx. */ add the following to the collection form <tr> <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_PRODUCTS_UPC; ?></td> <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_upc', $pInfo->products_upc, zen_set_field_length(TABLE_PRODUCTS, 'products_upc')); ?></td> </tr> /* collect_info_metatags.php * add products_upc => '' to the $parameters associative array * add p.products_upc to the SQL query on line 34 apprx * add p.products_upc to the SQL query on line 42 apprx */ add to line 148 apprx ' <strong>' . TEXT_PRODUCTS_UPC . '</strong> ' . $pInfo->products_upc /* preview_info.php * add p.products_upc to SQL query on line 18 apprx preview_info_meta_tags.php * add p.products_upc to SQL query on line 18 apprx */ add to line 59 apprx <td class="main" valign="top"> <?php echo '<strong>' . TEXT_PRODUCTS_UPC . '</strong> ' . ($pInfo->metatags_upc_status == '1' ? $pInfo->products_upc : TEXT_META_EXCLUDED); ?> </td> */ ./zencart/admin/includes/modules/ update_product.php * add products_upc => zen_db_prepare_input($_POST['products_upc']) to $sql_data_array associative array at line 33 apprx copy_to_confirm.php * add products_upc to the SQL query on line 35 apprx * add products_upc to the SQL query on line 53 apprx * add '" . zen_db_input($product->fields['products_upc']) . "', to line 65 apprx category_product_listing.php */ add to line 214 apprx case (7): $order_by = " order by p.products_upc DESC, pd.products_upc"; /* * add p.products_upc to line 245 apprx * add p.products_upc to line 266 apprx */ add to line 332 apprx <td class="dataTableContent"><?php echo $products->fields['products_upc']; ?></td> /* ./zencart/includes/modules/pages/product_info/ main_template_vars.php * add p.products_upc to line 56 apprx * add $products_upc = $product_info->fields['products_upc']; to line 102 apprx */ add to line 168 apprx $flag_show_product_info_upc = zen_get_show_product_switch($_GET['products_id'], 'upc'); /* ./zencart/includes/templates/template_default/templates/ tpl_product_info_display.php */ add to line 123 <?php echo (($flag_show_product_info_upc == 1 and !empty($products_upc)) ? '<li>' . TEXT_PRODUCT_UPC . $products_upc . '</li>' : '') . "\n"; ?> /* ./zencart/includes/modules/pages/advanced_search_result/ header_php.php To line 136 apprx 'PRODUCT_LIST_UPC' => PRODUCT_LIST_UPC, */ line 167 apprx case 'PRODUCT_LIST_UPC': $select_column_list .= 'p.products_model'; break; /* */ line 302 apprx LIKE '%:keywords%' OR p.products_upc /* */ line 423 apprx case 'PRODUCT_LIST_UPC': $order_str .= "p.products_upc " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_upc"; break; /* ./zencart/includes/index_filters/ default_filter.php */ Line 116 apprx case 'PRODUCT_LIST_UPC': $listing_sql .= "p.products_upc " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_upc"; break; /* ./zencart/includes/modules/pages/index/ main_template_vars.php */ line 163 apprx case 'PRODUCT_LIST_UPC': $select_column_list .= 'p.products_upc, '; break; /* ./zencart/includes/modules/ product_listing.php */ line 95 apprx case 'PRODUCT_LIST_UPC': $lc_align = ''; $lc_text = $listing->fields['products_upc']; break; /*
Thanks for reading and any contributions or ideas of things I may have done wrong will be much apprciated,
--Axpen


? So i've done just that, this adds the UPC field to the product_type named product (the generic one). How I went about this was with alot of grep and vi
. I also tried to model the UPC around the model field, as they are relatively close to the same thing. Ok without any further deliberation I shall now unveil the UPC field:
.


