Jump to content
electriz

[Free module] Custom order reference

Recommended Posts

Custom Order Reference

by PrestaCraft

customorder.png

 

Current module version: 1.2.1

PrestaShop compatible: 1.6, 1.7

http://prestacraft.com/custom-order-reference/

 

You can choose one of the following order reference generation format:

  • Default PrestaShop - If You want to restore to default
  • Number-Day-Month-Year [incrementing number within a day] - Useful if You want to count the number of orders within a day and include it in the reference
  • Number-Month-Year [incrementing number within a month] - Useful if You want to count the number of orders within a month and include it in the reference
  • Number-Year [incrementing number within a year] - Useful if You want to count the number of orders within a year and include it in the reference
  • Random number - If You want numbers instead letters
  • Incrementing number - If You want incrementing numbers instead letters

 

Remember that new choice won't affect existing orders. It will take effect right after save for all new orders.

 

Screenshots

1YAQlMr.png

 

Changelog:

v1.2.1

- Removed PHP notice in BackOffice configuration page, thanks to @Davide from PS forums

v1.2.0
Core changes:
- Removed override of PaymentModule.php and all logic now is located in hook actionValidateOrder

Bug fixes:
- Separator is now only "-" (for compatibility reasons)
- Code matches PSR-2 and PrestaShop standards
- Checked compatibility with 1.7
 

v1.1

New features:
- New generation method: Number-Day-Month-Year

 
Bug fixes:
- Fixed error occuring when reference was too long (by increasing this field length to 26)
- Removed required * symbol from separator (as it's not required, just recommended)
- Removed error modal in module configuration page
 

Download

 - version 1.2.1 - Newest and strongly recommended (see changelog)

 

IF YOU LIKE THIS MODULE, PLEASE DONATE AND SHARE ❤️

customorderreference_1.2.1.zip

Edited by electriz (see edit history)
  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

thank you nice module and professional

but i think it would be much better if we could remove this "-".  i've tried to remove it it works fine :D

but please notice that if you turned the debug mode this error message appear 

http://prnt.sc/c5hw7m

===

do you plan in the future add

number day month year

ex 114816

1 = number

14 day

8 month

16 year 2016

Edited by fatheeym (see edit history)

Share this post


Link to post
Share on other sites

Thanks for using my module and feedback :)

 

but i think it would be much better if we could remove this "-".  i've tried to remove it it works fine :D

but please notice that if you turned the debug mode this error message appear 

http://prnt.sc/c5hw7m

 

Well, it depends. If you don't like, you disabled it and it's fine for you :)

 

About this error - it's nothing big. I'm going to fix it with next update.

 

 

do you plan in the future add

number day month year

 

Currently I'm not planning this. However if there would be more request, I'll add it.

 

Updated in 1.1

Edited by electriz (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

New version released! (1.1)

 

New features:

- New generation method: Number-Day-Month-Year
 
Bug fixes:
- Fixed error occuring when reference was too long (by increasing this field length to 26)
- Removed required * symbol from separator (as it's not required, just recommended)
- Removed error modal in module configuration page
  • Like 1

Share this post


Link to post
Share on other sites

iam sorry for late but i was in trobles and now i'm just get start

any way i test your module in localhost it works very well but on my site i get this error

when i choose any method with date ( day year month

i mean just randon and increasment number working very good i know it's not related with your module the problen in my site but i wish if you help me

 

http://prnt.sc/ccc2z3

Share this post


Link to post
Share on other sites

iam sorry for late but i was in trobles and now i'm just get start

any way i test your module in localhost it works very well but on my site i get this error

when i choose any method with date ( day year month

i mean just randon and increasment number working very good i know it's not related with your module the problen in my site but i wish if you help me

 

http://prnt.sc/ccc2z3

 

Thanks for this info.

Indeed it works on localhost. As I read it's something with regex characters escaping.

It may come because of separator removal.

 

As temporary fix I suggest you trying to remove all pluses (+) from queries (because you are not using separators). And then let me know if it's fine.

 

But you know, this module is not intended to remove separators. They are used to fetch parts of order reference, so it know which value it should increment, and which not. While not using separator its just one big number.

Edited by electriz (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

its working when i add a seperator i have no idea why :/

it works very well on my localhost and on my test server too

but on my real site it's not working without seperator :/

i don't know how to remove + from queries

Share this post


Link to post
Share on other sites

i've removed this line

AND reference REGEXP "^[0-9]*'.$separator.'+[0-9]*'.$separator.'+[0-9]*'.$separator.'+'.$year.'"

 

and it works very well now

  • Like 1

Share this post


Link to post
Share on other sites

Great module, have only two problems: 

 

1. If i generate a new order sometimes the module generate the same Reference ID as before, really weird.

2. i use the year Logical like : AB0001-2016. How can i change the incrementing for the next number? I wish that the next number after 0001 is 0055 (example) and not 0002. than 0056, 0057....

 

thank you

 

Akos

Edited by m3442a (see edit history)

Share this post


Link to post
Share on other sites

1.2.0 version of this module is now realased!

See changelog for more infos. You can use it with PrestaShop 1.6 and 1.7 versions.
 

Share this post


Link to post
Share on other sites

When I install everything right, but when I'm going to configure it shows me this  Notice on line 716 en archivo /public_html/vendor/prestashop/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code
[8] Undefined index: id

Why ? PS 1.7.3.1

 

Share this post


Link to post
Share on other sites

Good morning, install the module in prestashop 1.7.2 and it works fine, but I have a problem with notifications. In my admin panel the order appears with a random number, this is perfect. But in the email sent as notification to the admin, the order ID still appears in the original Prestashop letter format. Is there any way to change this ID in Alert emails?

Thank you very much in advance!

Best regards.

consulta.jpg

Share this post


Link to post
Share on other sites

Exception return by module custom_order_reference for enable. Error when activating custom_order_reference. Class OrderPaymentOverrideOriginal_remove5b17c843c9615 does not exist.

 

I got this when I try to activate the module ! 

 

Share this post


Link to post
Share on other sites

Hi,

We used this module for a few months ago with the Number-Year configuration but now we get two orders with the same order reference.

The two orders are saved within one second (2018-06-12 18:43:42 and 2018-06-12 18:43:43).

I think the module should utilize some database table with locking mechanism during reference creation.

Are there anybody to plan to solve this issue?

Share this post


Link to post
Share on other sites

The order code has hung on the digit 10, can someone help?
With each new order the code remains on the number 10, does not change.

Share this post


Link to post
Share on other sites

Hi, 

If you add `id` attribute for each radio you prevent notice error on php 7.2

'values'=> array(
	array(
		'id' => "PC_ORDER_REF_0",
		....
	array(
		'id' => "PC_ORDER_REF_1",
		....

 

Share this post


Link to post
Share on other sites

Hello,

thanks for this free module.

 

how i can start for example with incremental number 7000? And not with 1.

and how to delete the "-"?

thanks.

Edited by Lele` (see edit history)

Share this post


Link to post
Share on other sites

Hello, the module is working great, but its giving me error on my log:

 

PHP Notice:  A non well formed numeric value encountered in /modules/customorderreference/customorderreference.php on line 288

 

 

Share this post


Link to post
Share on other sites

Hi, many thanks for this module. It works fine. Exept when I create an order in the backend. Than I have the PrestaShop Order ID like this "OKTZJNXLV". Is there a way to extend the module to such self-entered orders?

Best regards
Michael

Share this post


Link to post
Share on other sites
Am 9.12.2018 um 9:23 PM schrieb Lele`:

how i can start for example with incremental number 7000? And not with 1.

When you change the last order reference number in the database to 7000, the next order will counted with 7001.

Share this post


Link to post
Share on other sites

hello. after I installed the module in 1.7.5.1 and I selected last option the prestashop front office becamed blocked. Do you have any solution to restore? And do you know why blocked? Thank you.

Share this post


Link to post
Share on other sites

The module only works for the banktransfer on my site and not for Ideal (dutch) or Paypal. How is that possible?

Share this post


Link to post
Share on other sites

I refer to the module that set number instead letters on orders in prestashop. Maybe I was mistake at the name of module. 

Share this post


Link to post
Share on other sites
27 minutes ago, Cr Rad said:

I refer to the module that set number instead letters on orders in prestashop. Maybe I was mistake at the name of module. 

 

Yes, generally it sets numeric references, because letters are prestashop's default (which you can still restore in settings).

I haven't test this for 1.7.5.1 yet, when I could do that I will provide more informations or update (if I can reproduce this weird situation)

 

33 minutes ago, peprojects said:

The module only works for the banktransfer on my site and not for Ideal (dutch) or Paypal. How is that possible?

Maybe those modules are not setting order references in actionValidateOrder hook. 
I would advise to go to Modules > Positions, look for "actionValidateOrder" and place my module at the end of the list - than trying to place an order with Ideal or Paypal.

Share this post


Link to post
Share on other sites
3 hours ago, electriz said:

 

Yes, generally it sets numeric references, because letters are prestashop's default (which you can still restore in settings).

I haven't test this for 1.7.5.1 yet, when I could do that I will provide more informations or update (if I can reproduce this weird situation)

 

Maybe those modules are not setting order references in actionValidateOrder hook. 
I would advise to go to Modules > Positions, look for "actionValidateOrder" and place my module at the end of the list - than trying to place an order with Ideal or Paypal.

The postion is already at the end of the list (see image)

customorderreference.png

Share this post


Link to post
Share on other sites
Posted (edited)
On 7/27/2018 at 11:07 AM, YAMER1 said:

The order code has hung on the digit 10, can someone help?
With each new order the code remains on the number 10, does not change.

 

managed to solve?

The reference is locked at number 10 and does not leave this number. Any help please.

Edited by joaocarloszen (see edit history)

Share this post


Link to post
Share on other sites
On 10/8/2019 at 4:10 PM, joaocarloszen said:

 

managed to solve?

The reference is locked at number 10 and does not leave this number. Any help please.

Sorry for late response but

1. Are you using this module in 1.2.1 version?
2. I suppose you have selected "Incrementing number" in the module configuration.

I've tested with 1.2.1 module version and "incrementing number" on PS 1.7.6 - and I've managed to get "11" reference after "10", so I can't reproduce this issue. 

Edited by electriz (see edit history)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More