Jump to content

[MODULE] Change Order reference using Order ID and/or Cart ID


Recommended Posts

  • 2 weeks later...

I´ve installed but when I finished some orders two numbers are shown in the payment details (bankwire) and in the confirmation e-mails:

 

No te olvides de insertar tu número de pedido 19_24 en el tema de su transferencia bancaria.

No te olvides de insertar tu número de pedido 20_25 en el tema de su transferencia bancaria.

No te olvides de insertar tu número de pedido 21_26 en el tema de su transferencia bancaria

 

The correct ID_order are 19, 20, and 21!!

please help!!

Link to comment
Share on other sites

looks like you might have it set to also show the "cart" number as the order reference. Try setting it like this.

 

I get 000000345 style references like this

 

see pic

 

 

 

I could be wrong though???

many thanks, I set off the cart ID option

Link to comment
Share on other sites

help! I can´t enter in the backoffice in modules, and in the frontffice an error appears in the last step of the cart (after choose payment method)-

The module worked well!! but after install the module I´ve modified the spanish tranlations in bankwire/ltranslations/es.

 

For unistall the module, Can I delete the folder ordrefchange? or I have to do anymore? or its a problem of the modifications in the spanish tranlations?

thanks

Link to comment
Share on other sites

[NEDERLANDS]

Update van de module. modrefchange v1.1

 

In de geupdate versie is het nu ook mogelijk om het aantal nullen gebruikt als voorloopnullen van de cart of order id in te stellen.

Standaard is dit tot 9 nullen maar is in te stellen van 1 t/m 10.

 

[ENGLISH]

Module update. modrefchange v1.1

 

In this updated version it is now possible to configure the number of zeros uses as padding before the cart or order id.

Standard this is set to 9 but can be configured between 1 and 10.

Edited by scorpionsworld (see edit history)
  • Like 4
Link to comment
Share on other sites

Hi guys, here is french translation, hope it's good certainly not perfect but it's a start.

 

Thank you for the module it's a good idea.

 

[FRENCH]

https://www.dropbox.com/s/e4nqzifjcppui0g/fr.php

 

Bonjour tout le monde, je viens de faire la traduction du module, j'espère qu'elle est correcte si quelqu'un peut vérifier ce serait pas mal en tout cas (attention mot clés) c'est pratique de pouvoir personnalisé la référence des commandes prestashop

 

by

Link to comment
Share on other sites

Dear Sir,. Could you add several simple and useful option to you fantastic module?

 

Namely:

 

1. Set starting number of orders ID (and as final order #) as it done for inoice numbers in Prestashop 1.5.3.1 (see Back Office-Orders-Invoices)

 

2. I think that Order ID, Order Number and Invoice numbers for the same order should nbe the same number.

 

Could you merge all these features/options in your module?

 

1. set leading zeros for order number

2. make invoice number = order number = order ID

3. set starting number for order's numbering. I.e. next order number will be for example 15456 and will be increment for each next number.

4. Possibility choose # or № as prefix for numbering orders as in different countries used or # or №.

 

The options "3" I made manually so far, but you can integrate it in your module. I run SQL Query

 

ALTER TABLE `ps_orders` AUTO_INCREMENT=15456;

 

 

Next I set in BO-Orders-Invoices starting number for order invoices to 15456

 

That's all.

 

Of couse you should chack that this number should be greater then last order_id in ps_orders table.

 

 

Please add this features to yur module and it will be most helpful thing for Prestashop' users!

 

Best regards. Thank you!

Link to comment
Share on other sites

Dear Sir,. Could you add several simple and useful option to you fantastic module?

 

Namely:

 

1. Set starting number of orders ID (and as final order #) as it done for inoice numbers in Prestashop 1.5.3.1 (see Back Office-Orders-Invoices)

 

2. I think that Order ID, Order Number and Invoice numbers for the same order should nbe the same number.

 

Could you merge all these features/options in your module?

 

1. set leading zeros for order number

2. make invoice number = order number = order ID

3. set starting number for order's numbering. I.e. next order number will be for example 15456 and will be increment for each next number.

4. Possibility choose # or № as prefix for numbering orders as in different countries used or # or №.

 

The options "3" I made manually so far, but you can integrate it in your module. I run SQL Query

 

ALTER TABLE `ps_orders` AUTO_INCREMENT=15456;

 

 

Next I set in BO-Orders-Invoices starting number for order invoices to 15456

 

That's all.

 

Of couse you should chack that this number should be greater then last order_id in ps_orders table.

 

 

Please add this features to yur module and it will be most helpful thing for Prestashop' users!

 

Best regards. Thank you!

I'm sorry to say, but the features you mention will not be put in this module.

The reason for this is that all mentioned features are meant to change either the order id or the invoice id, while the module is only meant to change the random code order reference.

The changes you mention can either be done by editing (PDF-)templates or by using an SQL query in BO->Advanced Parameters->SQL Manager

Link to comment
Share on other sites

The reason for this is that all mentioned features are meant to change either the order id or the invoice id, while the module is only meant to change the random code order reference.

 

Daer Sir, did you mean that this module generate random numeric number, not increment number?

Link to comment
Share on other sites

Many thanks for your job scorpionsworld. I only have one problem with your module, it doesn't work the function of using zeros for the order ID prefix. If I have activated the option it doesn't work, and also if I specify a number of "0" to use, it doesn't work too. ¿Could you help me? :-)
Could you please check if the module is hooked correctly to 'actionvalidateorder' in Backoffice->Moduels->Positions?
Link to comment
Share on other sites

And the module doesn't do anything to the order reference when an order is placed?

 

Yes, the module works, it replaces the letter code used by prestashop with the corresponding numbers, even if I add something as prefix (a letter for example) works. The only thing that don't work is if you try to use zeros to prefix the order.

 

35lccbs.jpg

Link to comment
Share on other sites

just a note

 

pay attention that your REF id is < than 9 characters

 

my REF code was GREEN000324 (11 characters) and prestashop dropped an internal error 500.

After debugging it turned out that it was the paypal module which freaked out.

 

Prestashop always reminds me internet explorer 6.0...

Edited by andrep (see edit history)
Link to comment
Share on other sites

This is strange, when I try to install from the BO I get a message saying "The module modules you uploaded is not a module" and nothing happens, it won't install. I'm using PS 1.5.3, am I missing something?

 

Never mind, I unzipped and pasted it in instead and was able to install it just fine. Great module, thanks!!

Edited by artofadornment (see edit history)
Link to comment
Share on other sites

Hmm, om de één of andere reden krijg ik de leading zero's niet actief...

Kun jij me eens uitleggen wat ik precies moet instellen voor onderstaand voorbeeld:

 

Gewenst ordernummer: 2013_0000[Order_id] (Totaal aantal posities na '2013_' is 6, dit is inclusief het aantal posities van de "Order_id").

 

Ik heb de volgende instellingen gemaakt/geprobeerd in PS1.5.1:

 

Use Order ID Enabled

Use Zeros to prefix Order ID Enabled

Number of zeros to prefix Order ID "Leeg"

Use Character(s) to prefix Order ID 2013_

Use Cart ID Disabled

Use Zeros to prefix Cart ID "Leeg"

Number of zeros to prefix Cart ID 6

Use Characters to prefix Order Reference "Leeg"

 

 

Use Order ID Enabled

Use Zeros to prefix Order ID Enabled

Number of zeros to prefix Order ID 6

Use Character(s) to prefix Order ID 2013_

Use Cart ID Disabled

Use Zeros to prefix Cart ID "Leeg"

Number of zeros to prefix Cart ID "Leeg"

Use Characters to prefix Order Reference "Leeg"

 

Beide geven als output 2013_74 o.i.d. ...

 

Wat doe ik verkeerd?

 

Misschien een extra tip voor de volgende versie: Gebruik van een datestamp voor de text prefix.

Alvast bedankt.

Link to comment
Share on other sites

@scorpionsworld

 

Awesome! Great module. Works perfect.

Thx a lot! :)

 

When doing the translations for German users I noticed that 4 items are missing in the translations files en.php and the nl.php:

 

Number of zeros to prefix Order ID

Number of zeros to use as padding. Must be between 1 and 10.

Number of zeros to prefix Cart ID

Number of zeros to use as padding. Must be between 1 and 10.

 

Anyhow, just one tiny little blemish ...

 

I attach a German translations for users in Germany, Austria or Switzerland:

Edited by eleazar (see edit history)
  • Like 1
Link to comment
Share on other sites

the only issue i have when i do use this module is that the order history

 

1. show payments made ( 2 times actual paid ) as it activates order a second time

 

if this could be fixed, it would be great

That certainly shouldn't happen as the module doesn't activate the order. I'll look in to it.

@scorpionsworld

 

Awesome! Great module. Works perfect.

Thx a lot! :)

 

When doing the translations for German users I noticed that 4 items are missing in the translations files en.php and the nl.php:

 

Number of zeros to prefix Order ID

Number of zeros to use as padding. Must be between 1 and 10.

Number of zeros to prefix Cart ID

Number of zeros to use as padding. Must be between 1 and 10.

 

Anyhow, just one tiny little blemish ...

 

I attach a German translations for users in Germany, Austria or Switzerland:

I'll add the German translation in the next updated release and add the missing translations in the Dutch and English translation files. Thanks for your work and input :)
Link to comment
Share on other sites

Hi i think i have found an issue with payement module.

 

With orders paid by check or bankwire no problem but when i'm doing paiement with CreditCard there is two entries for one order same amount and same time but with différent order_reference (in table : ps_order_payment) this cause wrong amount in stats.

 

When i disable the module of course ther is no beautiful order reference but just one order paiement.

 

post-445073-0-01132500-1362423895_thumb.png

 

what do you think ?

 

thank for your reply

Link to comment
Share on other sites

Module werkt niet samen met Multisafepay? Is hier een oplossing voor? aangezien multisafepay door de meeste nederlandse klanten word gebruikt?

Als ik even heel bijdehand mag zijn, een oplossing is er niet nee. Zeker niet als ik niet wat specifieker weet wat je bedoeld met 'Module werkt niet samen met Multisafepay'.
Link to comment
Share on other sites

I'm not even shure why the order_payment record gets doubled, probably because of the order details getting saved after changing the reference in the module hook execution.

I will be posting an update soon where the first order_payment record will be deleted before changing and saving the order details, this should prevent doubles

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

I'm not even shure why the order_payment record gets doubled, probably because of the order details getting saved after changing the reference in the module hook execution.

I will be posting an update soon where the first order_payment record will be deleted before changing and saving the order details, this should prevent doubles

Hi scorpionsworld.

Thanks for this great module.

Any news about double payment?

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

Hi great module to fix an issue that shouldn't be an issue at all, but it is. I too am getting the double payments when using credit card, and I'm on PS 1.5.3.1.

 

One question, if I have it prefixed with 5 leading 0s, will it stay at 6 numbers in the reference field once we get to an order number of 10 or will it go to up 7, then 8, then 9 and so on? We need the number to be at 6 digits for our accounting application and I need to make sure of this before we get going on it so I would like to set it up properly.

 

Is it then possible to change the number of leading 0s once we hit the 6 digit mark to keep it at 6 digits?

 

Thanks for the great module.

Link to comment
Share on other sites

Hi great module to fix an issue that shouldn't be an issue at all, but it is. I too am getting the double payments when using credit card, and I'm on PS 1.5.3.1.

 

One question, if I have it prefixed with 5 leading 0s, will it stay at 6 numbers in the reference field once we get to an order number of 10 or will it go to up 7, then 8, then 9 and so on? We need the number to be at 6 digits for our accounting application and I need to make sure of this before we get going on it so I would like to set it up properly.

 

Is it then possible to change the number of leading 0s once we hit the 6 digit mark to keep it at 6 digits?

 

Thanks for the great module.

I haven't had time yet to resolve the double payment records yet.

 

prefixing with 5 leading zero's means `a maximum of 5 leading zero's`. reaching ordernumber higher then 9 will result in 1 less zero prefix. as soon as you go over the 6 digits ordernumber (e.g. 999999), the ordernumber will of course proceed at 7 digits and so on...

Link to comment
Share on other sites

Hi scorpionsworld, your module is very usefull and all feedbacks very positive. I am not an expert and bifore installino your module i have a question.

 

I read that users made translations in French and Spanish: what needs to be translated?

 

Navid

Link to comment
Share on other sites

Hi, first of all many thanks for that module, very useful! I have meaningful order id and invoice id, which is the same number.

 

Can I ask you, why is a delivery slip number different from order id or invoice id? Is there a way to keep those three ids with same number?

 

I want:

order id 00000009, invoice id (with prefix) FA0000009 and delivery slip id DL0000009

 

I have:

order id 00000009, invoice id (with prefix) FA0000009 and delivery slip id DL0000001

Link to comment
Share on other sites

  • 2 weeks later...

Hi scorpionsworld, your module is very usefull and all feedbacks very positive. I am not an expert and bifore installino your module i have a question.

 

I read that users made translations in French and Spanish: what needs to be translated?

 

Navid

The module configuration page is the only part that might need translation (Default English).

Hi,

do you this addon could work on 1.4.8 ??

 

Thanks

Not sure. Haven't tested the module on versions prior 1.5.x

Hi, first of all many thanks for that module, very useful! I have meaningful order id and invoice id, which is the same number.

 

Can I ask you, why is a delivery slip number different from order id or invoice id? Is there a way to keep those three ids with same number?

 

I want:

order id 00000009, invoice id (with prefix) FA0000009 and delivery slip id DL0000009

 

I have:

order id 00000009, invoice id (with prefix) FA0000009 and delivery slip id DL0000001

That's most probably because delivery slips follow their own sequential numbering
Link to comment
Share on other sites

Hello there, first of all I just want to say thank you for the module as it seems odd to have the order reference number be totally different from the invoice number as Prestashop does by default.

 

I wanted to give some data on my live test experience. Using: Fresh install of PrestaShop 1.5.4.1 , but did tweak the custom theme a bit - Newatch UNIVERSEL 1.5 Responsive

 

We ran into the issue where My site currently has payment setup for paypal, authorize.net, and checks however with placed orders upon review on the order details page in the Back Office, under the payment section it says:

No payments are available. These orders have the green PAYMENT ACCEPTED status.

 

In attempts to troubleshoot:

 

An example order number was MSM0000091 and appears that is too long since I get this error when trying to manually apply a payment:

 

[PrestaShopException]

 

Property OrderPayment->order_reference length (10) must be between 0 and 9

at line 837 in file classes/ObjectModel.php

 

It appears the length of "use zeros to prefix" and "use characters to prefix" caused too long of a number when combined.

Link to comment
Share on other sites

Hello there, first of all I just want to say thank you for the module as it seems odd to have the order reference number be totally different from the invoice number as Prestashop does by default. I wanted to give some data on my live test experience. Using: Fresh install of PrestaShop 1.5.4.1 , but did tweak the custom theme a bit - Newatch UNIVERSEL 1.5 Responsive We ran into the issue where My site currently has payment setup for paypal, authorize.net, and checks however with placed orders upon review on the order details page in the Back Office, under the payment section it says: No payments are available. These orders have the green PAYMENT ACCEPTED status. In attempts to troubleshoot: An example order number was MSM0000091 and appears that is too long since I get this error when trying to manually apply a payment: [PrestaShopException] Property OrderPayment->order_reference length (10) must be between 0 and 9 at line 837 in file classes/ObjectModel.php It appears the length of "use zeros to prefix" and "use characters to prefix" caused too long of a number when combined.

Correct. For longer reference numbers. The OrderPayment class needs to be overriden.

I hope I will have some time in the near future to correct this issue by implementing such an override as well as solving some other issues with the hook function

  • Like 1
Link to comment
Share on other sites