necrosaro420 Posted August 27, 2018 Share Posted August 27, 2018 I can't stand that when someone places an order, that it assigns random letters. I process orders in the order they come in, so it makes it pretty hard to organize with just a bunch of random letters. Is there a way, or module or something that will change the order number letters to actual numbers, as well as put them in order? Say First order is 21000, next that comes in is 21001, 21002, 21003 etc? Thanks Link to comment Share on other sites More sharing options...
Guest Posted August 27, 2018 Share Posted August 27, 2018 There is a sequential order number Link to comment Share on other sites More sharing options...
necrosaro420 Posted August 27, 2018 Author Share Posted August 27, 2018 Is that in the newest version or something? Still trying to get the site up and going, and when I did test orders a month ago, it was giving random letters as order numbers. Link to comment Share on other sites More sharing options...
Guest Posted August 27, 2018 Share Posted August 27, 2018 That is the order reference Link to comment Share on other sites More sharing options...
ecommerce16 Posted August 27, 2018 Share Posted August 27, 2018 There are several modules for this. I personally lik thisone because you can also setup customized numbers for deliveryslips, credit slips and it has the possibility to edit an order(before changing the status to send or preparation): https://addons.prestashop.com/nl/orderbeheer/24429-orders-management-pro-edit-orders-and-custom-numbers.html Also thisone is very helpfull because it can also change your invoice and delivery templates: https://addons.prestashop.com/nl/boekhouding-fakturatie/21817-pdf-invoice-template-delivery-custom-number.html Link to comment Share on other sites More sharing options...
realloyalist Posted August 27, 2018 Share Posted August 27, 2018 If you want a free solution you can modify the code yourself. I have set the Order Reference to match the Order ID which is a sequential number. I then set my invoice numbers up to coincide with the same number so now the Order Reference, Order ID, and Invoice number all relatively match. You can have the Order Reference generated/set in the PaymentModule.php file within the Classes directory. If you modify the file directly you will need to make the change anytime Prestashop is updated and that file is replaced. In PaymentModule.php around line 381 for me you will find a block of code like so, if (!$result) { PrestaShopLogger::addLog('PaymentModule::validateOrder - Order cannot be created', 3, null, 'Cart', (int)$id_cart, true); throw new PrestaShopException('Can\'t save Order'); } Right after this code block insert the following two lines. $order->reference = str_pad($order->id, 6, '0', STR_PAD_LEFT); $order->update(); The code as is will set the Order Reference as the Order ID as a 6 digit number with 0 as a filler before the Order ID. I did not come up with this myself. I adapted the info from an old forum topic, https://www.prestashop.com/forums/topic/446780-change-to-same-number-idorder-and-reference/ 1 Link to comment Share on other sites More sharing options...
Guest Posted August 27, 2018 Share Posted August 27, 2018 Thank you! Link to comment Share on other sites More sharing options...
necrosaro420 Posted August 28, 2018 Author Share Posted August 28, 2018 Thanks. Is there a way to start it from a specific number then? Link to comment Share on other sites More sharing options...
Knowband Plugins Posted August 28, 2018 Share Posted August 28, 2018 To start it from the specific number, you need to reset the auto increment of the order table. Open the orders table from the phpMyAdmin, Go to Operations & set the autoincrement to the desired number as shown in below screenshot. 1 Link to comment Share on other sites More sharing options...
muynck Posted April 9, 2020 Share Posted April 9, 2020 @necrosaro420 I don't know if you still need a solution for this? I have created a module for this problem: https://github.com/blauwfruit/orderreference/releases/tag/1.1.2 Tell me what you think! Link to comment Share on other sites More sharing options...
Jedimindtriks Posted April 20, 2020 Share Posted April 20, 2020 On 4/9/2020 at 10:06 AM, muynck said: @necrosaro420 I don't know if you still need a solution for this? I have created a module for this problem: https://github.com/blauwfruit/orderreference/releases/tag/1.1.2 Tell me what you think! Installed this mod, however there is now nothing under the "reference" field in orders. its just blank, even when opening the order PDF In the module, i tried placing numbers in the "format" field as it was unclear what i should put here. Kind regards Link to comment Share on other sites More sharing options...
muynck Posted April 22, 2020 Share Posted April 22, 2020 @Jedimindtriks - What is your PrestaShop version? - Can you share the format? Link to comment Share on other sites More sharing options...
luisleitaoaudio Posted June 19, 2020 Share Posted June 19, 2020 check this free module: 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now