Guest Posted May 13, 2010 Share Posted May 13, 2010 I need one more field at New products creation caled - Measurement (there will inserted values as "box", "piece" etc), so i have added new COLUMN to TABLE products_description called products_merv code: ALTER TABLE products_description ADD products_merv VARCHAR(60) AFTER products_name; INSERT INTO `products_description` (`products_merv`) VALUES ('box'); made all necessary changes in admin/categories.php added the row to call from db created $pInfo->products_merv = tep_get_products_merv($pInfo->products_id, $languages[$i]['id']); etc. but i have one error - Fatal error: Call to undefined function tep_get_products_merv() in /var/www/shop/admin/categories.php on line 729 can someone tell me what i have missed? on this part: <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?> <tr> <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_MERV; ?></td> <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['merv']) . ' ' . tep_draw_input_field('products_merv[' . $languages[$i]['id'] . ']', (isset($products_merv[$languages[$i]['id']]) ? stripslashes($products_merv[$languages[$i]['id']]) : tep_get_products_merv($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> <?php } ?> Link to comment Share on other sites More sharing options...
Guest Posted May 13, 2010 Share Posted May 13, 2010 have found the error: forgot to add this: function tep_get_products_merv($product_id, $language_id = 0) { global $languages_id; if ($language_id == 0) $language_id = $languages_id; $product_query = tep_db_query("select products_merv from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_merv']; } to admin/includes/functions/general.php Link to comment Share on other sites More sharing options...
Guest Posted May 13, 2010 Share Posted May 13, 2010 There is one more thing! How can i add the value from: TABLE - products_description COLUMN - products_merv i want to add the VALUE from products_merv to: TABLE - orders_products COLUMN - products_merv after the order is placed i have added this code: added to - cataloge/include/functions/general.php function tep_get_products_merv($product_id, $language = '') { global $languages_id; if (empty($language)) $language = $languages_id; $product_query = tep_db_query("select products_merv from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language . "'"); $product = tep_db_fetch_array($product_query); return $product['products_merv']; } i can`t manage to find the code that adds all other VALUES from TABLE - products_description to TABLE - orders_products Name Module Price etc... after the order is placed Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.