Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

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;image.png.8b67567636f49f1553edc3633dd565b1.png

#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
image.png.0d59e879615b027de6cef95d43d85be0.png
instead of just #2
image.png.dc3eb74537b60a23b4ba60d1ab413a3a.png


Can anyone please help? Many thanks!

Link to comment
Share on other sites

found the solution!

includes/languages/english/orders.php
define('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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...