Non-sequential orderids
10-11-2017 12:47 pm
Quick question. I don't like the orderids being sequential. Sometimes on a slow day I may have a customer make two purchases, and from this they can tell how many orders have been placed in the time between their orders, how can change this so the orderids are either random or have a random gap?
0 | 0
01-16-2018 12:31 am
1. Go to Contents -> Modules and scroll to or search for the Custom Changes module. Click the Green Modules Hooks button.
2. On the Module Event Hooks page enable the place_order_final event. If your server permissions allow it a modules/custom_changes/events/place_order_final.php file will be created.
3. Using FTP, or by clicking the link and using the Gahela admin file editor insert the following line of code into this file:
Then, when an order is placed the orderid will be randomly between 10-40 higher than the previous order.
2. On the Module Event Hooks page enable the place_order_final event. If your server permissions allow it a modules/custom_changes/events/place_order_final.php file will be created.
3. Using FTP, or by clicking the link and using the Gahela admin file editor insert the following line of code into this file:
Database::run('ALTER TABLE gfw_orders AUTO_INCREMENT=?', array($orderid + rand(10, 40)));
Then, when an order is placed the orderid will be randomly between 10-40 higher than the previous order.
Bill Brewer Gahela
1 | 0
01-16-2018 01:03 am
FYI: No core code was changed to create this modification, so it will not affect the ability of the software to be updated. This is the design of the Gahela module system. There are code hooks, which make changes easy.
Bill Brewer Gahela
0 | 0
1 to 4 of 4