Walrus Posted April 17, 2016 Share Posted April 17, 2016 (edited) How can I ensure customers see the order number, in place of the variable generated by Prestashop, in email notifications and also in the customer's Order History? For example, show 12345678 instead of a random 736482374. I have searched but not found any fixes, or topics to which I can reply. I cannot add screenshots once topic is posted so have added them here: EMAIL CONFIRMATION: http://examaids.com/files/psorder-01.png ORDER HISTORY: http://examaids.com/files/psorder-02.png Thanks. Edited April 17, 2016 by Walrus (see edit history) 1 Link to comment Share on other sites More sharing options...
Daresh Posted April 17, 2016 Share Posted April 17, 2016 Check out the free module Numeric Order Reference 1 Link to comment Share on other sites More sharing options...
Walrus Posted April 17, 2016 Author Share Posted April 17, 2016 I already applied a fix manually so order numbers are used instead of letters. I think that's what your module does. No? I want to use order numbers in emails and in customer's account pages, instead of the default variable. Link to comment Share on other sites More sharing options...
Daresh Posted April 17, 2016 Share Posted April 17, 2016 How did you apply that fix? Link to comment Share on other sites More sharing options...
Walrus Posted April 17, 2016 Author Share Posted April 17, 2016 (edited) Changed file classes/order/Order.php after finding fix in forum. Seems lots of people do not like the random letters, or the random order numbers. I think we are veering away from the topic. Do you know how I can find solution for my problem? Edited April 17, 2016 by Walrus (see edit history) Link to comment Share on other sites More sharing options...
Daresh Posted April 17, 2016 Share Posted April 17, 2016 I'm not sure what you have done, but with my module the once generated order reference is visible everywhere, in emails, order history etc. Link to comment Share on other sites More sharing options...
Walrus Posted April 17, 2016 Author Share Posted April 17, 2016 To clarify, I don't want to show order reference, which is next to useless. I would hide it if I could but it doesn't do harm (possibly confuse some customers when asked for the order number), so may as well leave it. What I want to do is show the 'order number' instead of the order reference. The order number (ID) Is shown in the subject line of each email notification, but NOT in the body where the variable 'order_name' is used. I want to show that order number (ID) in the body of the emails and in the customer's Order History page. In the HTML email templates, I see the variable 'order_name' and not the order number (ID). When used, order_name actually grabs the order reference (random letters by default). What your module does, I think, is change the letters into numbers. I've already done that. It's all very confusing when what's needed is simple: add order number everywhere, let user specify start number and format (000-000-001, or 00001, or {REF}-0000-0000-0001, etc) , and increment it with each order but I digress. Link to comment Share on other sites More sharing options...
Daresh Posted April 17, 2016 Share Posted April 17, 2016 My module changes the random letters in reference to random numbers or order ID, you can also add a prefix. Link to comment Share on other sites More sharing options...
Walrus Posted April 17, 2016 Author Share Posted April 17, 2016 (edited) I know there is a variable lurking somewhere because Prestashop uses it to add order ID in the email subject line but NOT in the body. However, your module did the trick, so many thanks for persevering (I looked some more but then had given up). What does the option "Add trailing zeros (to order ID)" do? I suspect add zeroes to end of order number but preview doesn't change when I select the option. Edited April 17, 2016 by Walrus (see edit history) Link to comment Share on other sites More sharing options...
Daresh Posted April 17, 2016 Share Posted April 17, 2016 It should change, without the trailing zeros the reference should be for example "21", with trailing zeros "000000021" Link to comment Share on other sites More sharing options...
Walrus Posted April 17, 2016 Author Share Posted April 17, 2016 Nope...Nothing happens to the *Preview* when I select the option. Possibly because I may have limited order numbers to 4, and the most recent order is already using all 4 digits? Do you mean leading zeros and not trailing zeros? I would expect trailing zeros, as in following some given thing (i.e., order number in this case) to look like 21000000. Link to comment Share on other sites More sharing options...
Daresh Posted April 17, 2016 Share Posted April 17, 2016 It may be the cause. You're right, it should be called leading zeros. Link to comment Share on other sites More sharing options...
Walrus Posted April 17, 2016 Author Share Posted April 17, 2016 Just had an order. Now I see order ID twice in the subject line. Any idea how I can hide actual order ID and keep order reference, which your module is replacing with order ID. Link to comment Share on other sites More sharing options...
Daresh Posted April 17, 2016 Share Posted April 17, 2016 I think you would need to change it in the mailalerts.php module, where we have: sprintf(Mail::l('New order : #%d - %s', $mail_id_lang), $order->id, $order->reference), to: sprintf(Mail::l('New order : %s', $mail_id_lang), $order->reference), Link to comment Share on other sites More sharing options...
Walrus Posted April 17, 2016 Author Share Posted April 17, 2016 I will try that tomorrow. Would be good if your module did it automatically when user selects the Order ID in the module. Link to comment Share on other sites More sharing options...
Daresh Posted April 17, 2016 Share Posted April 17, 2016 That would require messing with some other module, so I won't do that Link to comment Share on other sites More sharing options...
Walrus Posted April 18, 2016 Author Share Posted April 18, 2016 I have modified mailalert.php Hopefully, we should see only order ID in the subject line. BTW, preview does work but I found it's not dynamic. You have to press Save. Link to comment Share on other sites More sharing options...
Daresh Posted April 18, 2016 Share Posted April 18, 2016 I think it should be fine. The preview runs the actual code that will be used next time with an order so all the settings must be saved. I think it's enough as for a free module Link to comment Share on other sites More sharing options...
Walrus Posted April 18, 2016 Author Share Posted April 18, 2016 Not complaining...I said preview wasn't working, you said it was, and I just discovered it is but have to save first. 1 Link to comment Share on other sites More sharing options...
Walrus Posted May 3, 2016 Author Share Posted May 3, 2016 Hey, I have a problem pretty sure it involves your module...it all worked fine, then order validation stopped after two,three orders. I posted error I get after disabling module in another thread about validation failure. I disabled module, and reverted mail alerts page, emptied cache. Any ideas why validation still doesn't work? What changes does installing module make to database if any? Hey, I have a problem pretty sure it involves your module...it all worked fine, then order validation stopped after two,three orders. I posted error I get after disabling module in another thread about validation failure. I disabled module, and reverted mail alerts page, emptied cache. Any ideas why validation still doesn't work? What changes does installing module make to database if any? Link to comment Share on other sites More sharing options...
Daresh Posted May 3, 2016 Share Posted May 3, 2016 The Numeric Reference module changes the reference field in orders table to VARCHAR(32) to fit all the prefixes etc. Link to comment Share on other sites More sharing options...
Walrus Posted May 3, 2016 Author Share Posted May 3, 2016 OK...how can I revert table or safely delete it? Prefer not to load backup SQL, which is NOT up to date, or accesible right now. Link to comment Share on other sites More sharing options...
Daresh Posted May 3, 2016 Share Posted May 3, 2016 Restoring backup is not necessary, just go to your PHPMyAdmin and there in the `orders` table structure, edit the `reference` field and change length from 32 to 9. Link to comment Share on other sites More sharing options...
Walrus Posted May 4, 2016 Author Share Posted May 4, 2016 I changed 'Length/Values' 32 to 9 and clicked Save but still order not validating. Link to comment Share on other sites More sharing options...
Daresh Posted May 4, 2016 Share Posted May 4, 2016 So it must be something else there, this module shoud not affect the order validation, it does only one simple thing - generates a different reference, and I don't think that reference is something that gets validated. Link to comment Share on other sites More sharing options...
Walrus Posted May 11, 2016 Author Share Posted May 11, 2016 Not sure what that something else could be. I had deactivated the module, so had concluded it cannot be the module. However, when I uninstalled it, the issue was resolved instantly. Link to comment Share on other sites More sharing options...
dnaonline Posted July 8, 2016 Share Posted July 8, 2016 Hi Just wanted to ask if this works with PS ver 1.6.1.6. I installed it to change the order name to order ID - But it still seems to give me those pesky random Letters. Hope you can help - as it will mean a huge deal for my client Link to comment Share on other sites More sharing options...
Daresh Posted July 8, 2016 Share Posted July 8, 2016 You need to have "Disable overrides" set to "No", maybe it's not set? 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