Jump to content

Recommended Posts

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
instead of just #2

Can anyone please help? Many thanks!

Share this post

Link to post
Share on other sites

found the solution!


---> by echo TEXT_ORDERS_NUMBER_PREFIX, can retrieve the content of configuration_key: ORDERS_NUMBER_PREFIX

original instruction:

    <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
    <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>

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now