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

  • 1 month later...

Anybody got the module without the trouble with double payment ? We bought it yesterday and can't use it... :-(

Bought? What do you mean bought, the module is offered for free...

And no, the double transactions issue is not solved yet...still working on getting that fixed

Link to comment
Share on other sites

[NL]
Ik ben er eindelijk aan toe gekomen een update te maken op deze module.
De verschrikkelijke dubbele betalingstransactie bug is gerepareerd en
een override op de OrderPayment class is toegevoegd om he order referentie veld te vergroten naar max. 100 karakters.

U kunt de Order Referentie Wijzigings module v1.3 vinden op https://www.dropbox.com/s/7kkhtgkrpq4h755/modrefchange.zip?dl=0

Indien eerdere versies reeds geïnstalleerd. Na upload module resetten en opnieuw configureren.

[EN]
I have finally come around updating this module.
Fixing the hideous double payment transaction bug and
adding an override on OrderPayment class to enlarge the order reference field to max. 100 characters.

Please find the module change order reference v1.3 at https://www.dropbox.com/s/7kkhtgkrpq4h755/modrefchange.zip?dl=0

If you have previously installed this module, please reset and reconfigure module after upload.

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

Hello everybody!

Hi Dr Nick...

Ok, not funny :)

When I try to install the module I get this Error :

Le ou les modules suivants n'ont pas été correctement installés :

  • - modrefchange :
    Impossible d'installer la surcharge : Class OrderPaymentOverrideOriginal does not exist
    Error while installing module class

Which translates to :

The following module wasn't installed properly

- Impossible to install the surcharge : Class OrderPaymentOverrideOriginal does not exist

Error while installing module class

And at the very bottom of the page I have :

[PrestaShop] Fatal error in module Module.php(1933) : eval()'d :

syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_FUNCTION

 

 

Do you know what isn't working?

I have Prestashop 1.5.4.1

Thanks

Edited by ITIS-Commerce.com (see edit history)
Link to comment
Share on other sites

Hello everybody!

Hi Dr Nick...

Ok, not funny :)

When I try to install the module I get this Error :

Le ou les modules suivants n'ont pas été correctement installés :

  • - modrefchange :
    Impossible d'installer la surcharge : Class OrderPaymentOverrideOriginal does not exist
    Error while installing module class

Which translates to :

The following module wasn't installed properly

- Impossible to install the surcharge : Class OrderPaymentOverrideOriginal does not exist

Error while installing module class

And at the very bottom of the page I have :

[PrestaShop] Fatal error in module Module.php(1933) : eval()'d :

syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_FUNCTION

 

 

Do you know what isn't working?

I have Prestashop 1.5.4.1

Thanks

Yeah, the override that's incorporated in the module isn't installed.

Please do the following using FTP to your webserver:

Check if you already have an existing OrderPayment.php in PS Root/override/classes/order/ with content.

If not, go to PS Root/modules/modrefchange/override/classes/order/ and move OrderPayment.php to your local drive.

Go back to PS Root/override/classes/order/ and move the OrderPayment.php from your local drive to your webserver.

Now go back into your Backoffice->Modules and try to install the module again.

  • Like 2
Link to comment
Share on other sites

Yeah, the override that's incorporated in the module isn't installed.

Please do the following using FTP to your webserver:

Check if you already have an existing OrderPayment.php in PS Root/override/classes/order/ with content.

If not, go to PS Root/modules/modrefchange/override/classes/order/ and move OrderPayment.php to your local drive.

Go back to PS Root/override/classes/order/ and move the OrderPayment.php from your local drive to your webserver.

Now go back into your Backoffice->Modules and try to install the module again.

 

Thanks, it worked!

Great module and thanks for the answer.

CHeers!

Link to comment
Share on other sites

Hello,

 

I use this module, too. Thank you for this.

 

But I still have a question:

 

What must I do, to become also the order-id in the new_order-Mail, which I become, when a customer makes an order?

 

I think there must be an modification in mailalerts.php, but I dont know the exact variable.

 

I have tested the following:

The original variable in mailalerts.php was: '{order_name}' => sprintf('%06d', $order->id),

this I changed in : '{order_name}' => $order->getUniqReference(),

 

Then the order-id is the same order-id (with the big letters) before I used your module.

 

I hope you can understand what I mean :-)

 

Best regards from Germany

 

PS: I use Prestashop 1.5.4.1

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

Hi,

 

I installed this module and I deleted it 5 minutes after.

Now i'm having pb when I want to see an order in my backoffice (orders>orders>(select an order to see the details). It told me it's an 500 errors

 

Also the mails of confirmation not sending.

 

Could you please help me to find a solution.

 

Thank you very much :)

Link to comment
Share on other sites

Hi,

 

I installed this module and I deleted it 5 minutes after.

Now i'm having pb when I want to see an order in my backoffice (orders>orders>(select an order to see the details). It told me it's an 500 errors

 

Also the mails of confirmation not sending.

 

Could you please help me to find a solution.

 

Thank you very much :)

First of all, you need to turn on error reporting changing /config/defines.inc.php set DEV_MODE to true.

Instead of the error 500 you will then get a much more descriptive error.

Secondly, deleting the module should have no effect on order confirmation email. My guess is you have another issue regarding the emails.

Link to comment
Share on other sites

Hi scorpionsworld,

 

first of all THANK you for that great module.

 

However I have trouble to get it installed. If I press the button to install the module, I receive a message:

 

Das folgende Modul konnte nicht installiert werden:

  • - modrefchange :
    Das Override kann nicht installiert werden: Die Eigenschaft definition in der Klasse OrderPayment ist bereits festgelegt.
    Error while installing module class

Translated:

The following module could not be installed:

  • - modrefchange :
    The Override can not be installed: The property definition in the OrderPayment class is already defined.
    Error while installing module class

I have V1.5.4.1 of prestashop version. May do you have any idea or suggestion what's going wrong here?

 

Thanks for all

Alexander

Link to comment
Share on other sites

Hi scorpionsworld,

 

first of all THANK you for that great module.

 

However I have trouble to get it installed. If I press the button to install the module, I receive a message:

 

Das folgende Modul konnte nicht installiert werden:

  • - modrefchange :
    Das Override kann nicht installiert werden: Die Eigenschaft definition in der Klasse OrderPayment ist bereits festgelegt.
    Error while installing module class

Translated:

The following module could not be installed:

  • - modrefchange :
    The Override can not be installed: The property definition in the OrderPayment class is already defined.
    Error while installing module class

I have V1.5.4.1 of prestashop version. May do you have any idea or suggestion what's going wrong here?

 

Thanks for all

Alexander

The error means the override that's incorporated in the module isn't installed.

Please do the following using FTP to your webserver:

Check if you already have an existing OrderPayment.php in PS Root/override/classes/order/ with content.

If you already have an OrderPayment.php override in this folder, you have to merge it's content with the PS Root/modules/modrefchange/override/classes/order/OrderPayment.php file.

If not, go to PS Root/modules/modrefchange/override/classes/order/ and move OrderPayment.php to your local drive.

Go back to PS Root/override/classes/order/ and move the OrderPayment.php from your local drive to your webserver.

Now go back into your Backoffice->Modules and try to install the module again.

Link to comment
Share on other sites

Help, tried installing on 1.5.4.1

I get the following error

 

Unable to install override: directory (/var/www/vhosts/kyboe-order.com/httpdocs/override/classes/order) not writable

Error while installing module class

 

Any Idea?

 

Thanks Johan

Read the above post ;) and also check if /var/www/vhosts/kyboe-order.com/httpdocs/override/ subfolders are writable (chmod 777 or 755)
Link to comment
Share on other sites

×
×
  • Create New...