ce7 Posted May 20, 2020 Share Posted May 20, 2020 hi, Installed this addon Order_Number_Prefixe and found that the configuration value will not write or update into the sql, can someone help to guide me how to connect the relation between the configuration key, configuration value with variable $prefix by using tep_db_query in admin/order.php ? the instruction sql to install: ALTER TABLE `orders` ADD `orders_prefix` VARCHAR( 32 ) DEFAULT NULL AFTER `orders_id`; INSERT INTO configuration VALUES ('', 'Order Number Prefix', 'ORDERS_NUMBER_PREFIX', 'y/m/', 'Enter the prefix of the orders numbers; ei: "y/m/" If the order date is october, 20th 2003, the order number will be: 03/10/orderID; Leave it blank if you do not want prefix.', 1, 23, '', '', NULL, NULL) the configuration will be write, and can be update if go to admin/configuration/my store/ edit, and I can update the y/m/ to 20/05/ however, how can I make the new 20/05/ to be update into table ORDER `orders_prefix` column? code from install instruction for admin/order.php does not update the 20/05/ to $prefix value.... $prefix_query = tep_db_query("select orders_prefix from orders where orders_id = '" . $GLOBALS['oID'] . "'"); $prefix_value = tep_db_fetch_array($prefix_query); $prefix = $prefix_value['orders_prefix']; right now the prefix only show up If I use phpmyadmin manually write 20/05/ into TABLE `orders` COLUMN `orders_prefix`,UPDATE `orders` SET `orders_prefix` = '2020/05/' WHERE `orders`.`orders_id` = 2; #1 after update the mystore y/m/ to 20/05/ (can update into configuration table, no problem) #2 has problem to show order number as 20/05/#2 (only show #2) so the goal is after update #1, the admin/order.php will show 20/05/#2 instead of just #2 Can anyone please help? Many thanks! Link to comment Share on other sites More sharing options...
ce7 Posted May 21, 2020 Author Share Posted May 21, 2020 found the solution! includes/languages/english/orders.phpdefine('TEXT_ORDERS_NUMBER_PREFIX', ORDERS_NUMBER_PREFIX); ---> by echo TEXT_ORDERS_NUMBER_PREFIX, can retrieve the content of configuration_key: ORDERS_NUMBER_PREFIX admin/orders.php original instruction: Replace: <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> by: <td class="pageHeading"><?php echo HEADING_TITLE . ' ' . $prefix . $HTTP_GET_VARS['oID']; ?></td> replace with my solution: <td class="pageHeading"><?php echo HEADING_TITLE . ' ' . TEXT_ORDERS_NUMBER_PREFIX; ?></td> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.