Jump to content

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


Recommended Posts

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

  • - modrefchange :

    The Override can not be installed: The property definition in the OrderPayment class is already defined.

    Error while installing module class

 This appears  when i triy to install in the version V1.5.5.0 of prestashop version. 

 

I have tryed the following tips:

 

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. 

 

 

But the error persists.

 

Can anyone help me?

 

 

PROBLEM SOLVED!!!!!

Edited by hpaixao (see edit history)

Share this post


Link to post
Share on other sites

Will this be able to match the Order # with the invoice # yet? Really need this feature. Great that it works on 1.6!

no, but i'm still investigating if this feature should be built in as an order can possibly contain more than one invoice. Maybe feature will be built in with its own set of configurable rules and sequence nr based on number of invoices attached to order (eg. Invoice nr #[ORDERNR], #[ORDERNR]_2, etc)

Share this post


Link to post
Share on other sites

no, but i'm still investigating if this feature should be built in as an order can possibly contain more than one invoice. Maybe feature will be built in with its own set of configurable rules and sequence nr based on number of invoices attached to order (eg. Invoice nr #[ORDERNR], #[ORDERNR]_2, etc)

 

Ah I see, but many carts offer this function, so yes I think it could be included somehow... Configurable rules would make this module very powerful... then you can start charging for it like $20 or something...

 

BUT LET ME BETA TEST IT FIRST :D haha.

Share this post


Link to post
Share on other sites

Ah I see, but many carts offer this function, so yes I think it could be included somehow... Configurable rules would make this module very powerful... then you can start charging for it like $20 or something...

 

BUT LET ME BETA TEST IT FIRST :D haha.

i won't suddenly charge for something that i've been offering for free all this time.
  • Like 1

Share this post


Link to post
Share on other sites

i won't suddenly charge for something that i've been offering for free all this time.

 

:). Well that confirms my suspicions. People from the Netherlands are the nicest =D. Can't wait to go back!

Share this post


Link to post
Share on other sites

  • 4 weeks later...

Just tried in PrestaShop version 1.6.0.6 and it works fine

 

Hier dus niet. kreeg een hele stapel errormeldingen en heb daarop de module maar weer gedelete. Kan ook wel zonder...

maar alleen kan ik nu in mn backoffice de bestellingen niet meer openen :(

krijg een lege pagina bij alle bestellingen. bij klanten > winkelwagens zie ik de bestellingen wel staan, maar dus niks bij bestellingen als ik daar op een bestelling klik. vrees dat er ergens in de database iets goed fout is gegaan. Database van gisteren teruggezet, maar nog steeds een lege pagina.

iemand een idee waar ik het zoeken moet nu?

 

ff de error:

[PrestaShop] Fatal error in module Module:

Uncaught exception 'ReflectionException' with message 'Class OrderPaymentOverrideOriginal_remove539ae66ee480d does not exist' in /var/www/.../classes/module/Module.php:2328 Stack trace: #0 /var/www/.../classes/module/Module.php(2328): ReflectionClass->__construct('OrderPaymentOve...') #1 /var/www/.../classes/module/Module.php(2237): ModuleCore->removeOverride('OrderPayment') #2 /var/www/.../web/classes/module/Module.php(272): ModuleCore->uninstallOverrides() #3 /var/www/.../modules/modrefchange/modrefchange.php(71): ModuleCore->install() #4 /var/www/.../controllers/admin/AdminModulesController.php(836): Modrefchange->install() #5 /var/www/.../controllers/admin/AdminModulesController.php(1006): AdminModulesControllerCore->postProcessCallback() #6 /var/www/.../web/classes/controller/Controller.php(171): AdminModulesControl

 

edit 2:

t zat m dus in een conflict tussen 2  overrides. deze gedelete en kon mn bestellingen weer zien...

mijn probleem solved dus

Edited by frank de beer (see edit history)

Share this post


Link to post
Share on other sites

[NL]

Het is eindelijk gelukt!  B)

Order referentie wijzigings module v1.5 update

Wat is veranderd?

  • paymentmodule class override vervangen voor order class override wat de voorgaande problemen meteen oplost, namelijk:

- Mailalert emails met oude foutieve referentie

- Mail naar klant met resterende voucher met foutieve referentie

- Orders aangemaakt in backoffice zonder aangepaste referentie

  • installer, uninstaller en update script stabieler gemaakt
  • datum/tijd voorvoegsel door middel van strftime functie
  • toevoeging van factuur en pakbon wijziging opties

Een groot aantal gebruikers die met een geldig mailadres de module hebben gedownload van mijn site zullen inmiddels een mail hebben ontvangen met een rechtstreekse downloadlink naar de nieuwe update.

 

Voor alle anderen, zie https://www.dropbox.com/s/7kkhtgkrpq4h755/modrefchange.zip?dl=0

 

---

[EN]

I finally got it working!  B)

Order reference change module v1.5 update

 

So, what has changed?

  • paymentmodule class override has been replaced by an order class override and custom hooks wich has solved the previous issues, namely:

- Mailalert emails with the old incorrect reference

- Email to customer concerning remainder voucher value with old incorret reference

- Orders created in PS Backoffice without modified reference

  • stabilized installer, uninstaller en update script
  • date/time formatting options added to prefix using strftime function
  • Addition of invoice and deliveryslip modification options

A large number of users who have downloaded the module on my site using a valid emailaddress should have received an email containing a direct download link for the new update.

 

For all others, see https://www.dropbox.com/s/7kkhtgkrpq4h755/modrefchange.zip?dl=0

Edited by scorpionsworld (see edit history)

Share this post


Link to post
Share on other sites

  1.  

    Yes, it does

    1. modrefchange (parsing errors in /modules/modrefchange/modrefchange.php),
    2. modrefchange (class is missing in /modules/modrefchange/modrefchange.php)

Share this post


Link to post
Share on other sites

I have this problem after installing the module and I still cannot install this module. Please advise what I should do. Thank you.

 

2 errors

  1. modrefchange (parse error in /modules/modrefchange/modrefchange.php)
  2. modrefchange (class missing in /modules/modrefchange/modrefchange.php)

Share this post


Link to post
Share on other sites

[NL]


Order referentie wijzigings module v1.5.1 update


Wat is veranderd?


  • Kleine bugfix

Een groot aantal gebruikers, ong. 630, die met een geldig mailadres de module hebben gedownload van mijn site zullen inmiddels een mail hebben ontvangen met een rechtstreekse downloadlink naar de nieuwe update.


 


Voor alle anderen, zie https://www.dropbox.com/s/7kkhtgkrpq4h755/modrefchange.zip?dl=0


 


---


[EN]


Order reference change module v1.5.1 update


 


So, what has changed?


  • Minor bugfix

A large number of users, about 630, who have downloaded the module on my site using a valid emailaddress should have received an email containing a direct download link for the new update.


 


For all others, see https://www.dropbox.com/s/7kkhtgkrpq4h755/modrefchange.zip?dl=0


Edited by scorpionsworld (see edit history)

Share this post


Link to post
Share on other sites

[NL]


Order referentie wijzigings module v1.5.2 update


Wat is veranderd?


  • Kleine bugfix op de hook installatie

Een groot aantal gebruikers, ong. 630, die met een geldig mailadres de module hebben gedownload van mijn site zullen inmiddels een mail hebben ontvangen met een rechtstreekse downloadlink naar de nieuwe update.


 


Voor alle anderen, zie https://www.dropbox.com/s/7kkhtgkrpq4h755/modrefchange.zip?dl=0


 


---


[EN]


Order reference change module v1.5.1 update


 


So, what has changed?


  • Minor bugfix on hook installer

A large number of users, about 630, who have downloaded the module on my site using a valid emailaddress should have received an email containing a direct download link for the new update.


 


For all others, see https://www.dropbox.com/s/7kkhtgkrpq4h755/modrefchange.zip?dl=0


Edited by scorpionsworld (see edit history)

Share this post


Link to post
Share on other sites

My apologies for all the troubles.

Seems a system glitch got in the way of some file synchronisation.

An updated version 1.5.2 is now in place.

Everybody that received an update e-mail with a direct download link can use that same link to download the updated version 1.5.2

Share this post


Link to post
Share on other sites

Hi,

 

for PS version 1.5.6.1 i can't uninstall/delete it .

 

I get the following error:

[PrestaShop] Fatal error in module Module.php(2099) : eval()'d :
Cannot redeclare OrderPaymentOverrideOriginal_remove53a467ea46d17::$definition

 

Thank you,

Share this post


Link to post
Share on other sites

Hi,

 

for PS version 1.5.6.1 i can't uninstall/delete it .

 

I get the following error:

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

Cannot redeclare OrderPaymentOverrideOriginal_remove53a467ea46d17::$definition

 

Thank you,

Good you pls send me a PM with FTP login, i will correct the issue by hand.

Share this post


Link to post
Share on other sites

Looks like uninstall/install or resetting the module is still giving issues, especially with the OrderPayment override.

I've seen the $definition variable being added to the override file twice because of the reset.

Anyone trying to reset or re-install the module must check the /override/classes/order/OrderPayment.php file manually until I've figured this one out  <_<

Share this post


Link to post
Share on other sites

i can't uninstall  :-(

 

[PrestaShop] Fatal error in module Module.php(2327) : eval()'d :
Cannot redeclare OrderPaymentOverrideOriginal_remove53a49c6f01ef5::$definition

 

and i can t see my orders , pleas help 

Share this post


Link to post
Share on other sites

i can't uninstall  :-(

 

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

Cannot redeclare OrderPaymentOverrideOriginal_remove53a49c6f01ef5::$definition

 

and i can t see my orders , pleas help

 

already fixed.sorry for not replying email. Sending out 500+ update emails has caused my mailserver to block all outbound mail

Share this post


Link to post
Share on other sites

Hi
finally i manually uninstall the module and install your latest version from your site.

Now it seems that it works with no problems.

I have some questions:

1. Can you give me an example on how to set date/time format? I try with no success.
2. How can i remove the prefixes underscore?
3. How can i setup the settings for the invoice and delivery slip? I set "Use Order ID" and "Use Cart ID" to "Yes" but it is use the invoice/deliveryslip sequence number instead of Order ID and/or Cart ID

Thank you,

Share this post


Link to post
Share on other sites

Order referentie wijzigingsmodule v1.5

Module to change the order reference using Order ID AND/OR Cart ID

Compatibility: Prestashop v1.5.X and above

 

Screenshots:

Prestadev_0043_zps5853860e.png

 

Downloadlink:

https://www.dropbox.com/s/0fens0r4jaudk1m/modrefchange.zip

 

Excellent Module! Thank's! But i have problem, i need to insert a date into the order reference. For example: SP-20140627-0000001

 

SP, normal, and the next is a date, and finally the id order... The first and the last, is easy, but i have no idea how to make the middle one, i try to put %F, but nothing happening.

 

PS: SOrry for my bad english.

Share this post


Link to post
Share on other sites

Hi

finally i manually uninstall the module and install your latest version from your site.

 

Now it seems that it works with no problems.

 

I have some questions:

 

1. Can you give me an example on how to set date/time format? I try with no success.

2. How can i remove the prefixes underscore?

3. How can i setup the settings for the invoice and delivery slip? I set "Use Order ID" and "Use Cart ID" to "Yes" but it is use the invoice/deliveryslip sequence number instead of Order ID and/or Cart ID

 

Thank you,

1. Unfortunately, despite testing, the date/time format isn't functioning at the moment. I'm already working on debugging the latest version.

2. That is something i will remove in the next release to give users the freedom to add underscores themselves.

3. Same as with the date/time format. Despite testing, the function isn't changing invoice and delivery slip.

 

 

Excellent Module! Thank's! But i have problem, i need to insert a date into the order reference. For example: SP-20140627-0000001

 

SP, normal, and the next is a date, and finally the id order... The first and the last, is easy, but i have no idea how to make the middle one, i try to put %F, but nothing happening.

 

PS: SOrry for my bad english.

Unfortunately, despite testing, the date/time format isn't functioning at the moment. I'm already working on debugging the latest version.

Share this post


Link to post
Share on other sites

 

  • - modrefchange :

    The Override can not be installed: The property definition in the OrderPayment class is already defined.

    Error while installing module class

 This appears  when i triy to install in the version V1.5.5.0 of prestashop version. 

 

I have tryed the following tips:

 

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. 

 

 

But the error persists.

 

Can anyone help me?

 

 

PROBLEM SOLVED!!!!!

 

 

How did you solve it please ? That's why is this forum for : SHARE solutions :rolleyes:

Share this post


Link to post
Share on other sites

Will this be able to match the Order # with the invoice # yet? Really need this feature. Great that it works on 1.6!

 

I gave the how to do this some months ago ;) Works like a charm at my shop for months, order, invoice and also delivery slip match :)

 

 

Hello, I did the modification myself on PS1.5.4.1, order ID also match invoice and delivery slip number now :

 

For invoices number and his pdf number :

 

In classes/pdf/HTMLTemplateInvoice.php :

 

Replace " number " line 45 ( number on the invoice pdf) and line 140 by " id_order " ( pdf file number ).

 

In classes/order/OrderInvoice.php

 

Remplace " number " line 665 by " id_order " ( back office invoice number ).

 

For delivery slip number and his pdf number :

 

In classes/pdf/HTMLTemplateDeliverySlip.php  :

 

Replace " delivery_number " line 42 by " id_order " ( number on the delivery slip pdf ) and line 90 " order->invoice_number " by " order_invoice->id_order " ( pdf file number )

 

In adminXXXX/themes/default/template/controllers/orders/_documents.tpl

 

Replace " delivery_number " line 71 by " id_order " ( back office delivery slip number ).

 

Share this post


Link to post
Share on other sites

And im trying and trying, but i can insert a date, please help  :wacko: .

 

 

 

 

To resolve the problem to install an uninstall,

 

1- uninstall modref from modules

2- go to you ftp, /override/classes/order and delete "Order.php" and "OrderPayment.php" on ps 1.6

Share this post


Link to post
Share on other sites

And im trying and trying, but i can insert a date, please help  :wacko: .

 

 

 

 

To resolve the problem to install an uninstall,

 

1- uninstall modref from modules

2- go to you ftp, /override/classes/order and delete "Order.php" and "OrderPayment.php" on ps 1.6

as mentioned before, date/time format is functioning
  • Like 1

Share this post


Link to post
Share on other sites

Delete 1.4 and Install 1.5.2

 

  • modrefchange : 
        Error while adding hook actionBeforeAddOrderInvoice

 

Trying add module (update)

 

  • modrefchange : 
        No upgrade has been applied
        To prevent any problem, this module has been turned off

 

I have no "Order.php" in override folder.

Edited by xMartin (see edit history)

Share this post


Link to post
Share on other sites

as mentioned before, date/time format is functioning

 

And, how can i resolve? i dont understand sorry. i trying but is not working.

 

 

Delete 1.4 and Install 1.5.2

 

  • modrefchange : 

        Error while adding hook actionBeforeAddOrderInvoice

 

Trying add module (update)

 

  • modrefchange : 

        No upgrade has been applied

        To prevent any problem, this module has been turned off

 

I have no "Order.php" in override folder.

 

maybe because you are using previous version, im using 1.6

Share this post


Link to post
Share on other sites

And, how can i resolve? i dont understand sorry. i trying but is not working.

 

 

 

 

maybe because you are using previous version, im using 1.6

now i'm curious...how can you use version 1.6 of the module when the module is at version 1.5.2?
  • Like 1

Share this post


Link to post
Share on other sites

By the way...version 1.5.3 is almost done. Found and fixed the issue with date/time format (annoying regular expressions) but still not happy about the installation/upgrade of the module and the issues around the overrides. It needs a little bit more attention.

  • Like 2

Share this post


Link to post
Share on other sites

Ik heb de hooks goed, op de volgende :

actionBeforeAddDeliveryNumber

actionBeforeAddOrder

actionBeforeAddOrderInvoice

 

Overrides zijn ook aanwezig, maar eigenlijk alleen order.php bevat veel code.

 

Krijg het maar niet werkend, wil echt van die vreselijke referentie nummers af.

Share this post


Link to post
Share on other sites

Ik heb de hooks goed, op de volgende :

actionBeforeAddDeliveryNumber

actionBeforeAddOrder

actionBeforeAddOrderInvoice

 

Overrides zijn ook aanwezig, maar eigenlijk alleen order.php bevat veel code.

 

Krijg het maar niet werkend, wil echt van die vreselijke referentie nummers af.

snap ik. Ik zal je vanmiddag of vanavond even mailen, dan mag je versie 1.5.3 met wat handmatige installatie instructies gaan case testen met jouw goedkeuring

Share this post


Link to post
Share on other sites

now i'm curious...how can you use version 1.6 of the module when the module is at version 1.5.2?

 

I don't know, but is working, and i dont have trouble to install and unistall the module.

 

I found a way to resolve my problem...

Share this post


Link to post
Share on other sites

in classes/order/Order.php go to "public static function generateReference()"

 

copy and paste the next code:

public static function generateReference()
	{
		
		$current_date = gmDate("Ymd-"); 
		$nrostring = strval(Tools::passwdGen(6, 'NUMERIC'));
		
		return "ES" . $current_date . $nrostring ;
		
	}

i did my self :D

 

This will generate a code like this:

 

SP20140701-123456.

 

The final 6 numbers are random numbers, for me its ok. :D

 

 

AND, a very important thing!

 

in classes/order/OrderPayment.php

 

in this section: 

'order_reference' => 	array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 9),

change the 9 to 18 or more: like this.

'order_reference' => 	array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 18),
Edited by engineerHopf (see edit history)

Share this post


Link to post
Share on other sites

 

in classes/order/Order.php go to "public static function generateReference()"

 

copy and paste the next code:

public static function generateReference()
	{
		
		$current_date = gmDate("Ymd-"); 
		$nrostring = strval(Tools::passwdGen(6, 'NUMERIC'));
		
		return "ES" . $current_date . $nrostring ;
		
	}

i did my self :D

 

This will generate a code like this:

 

SP20140701-123456.

 

The final 6 numbers are random numbers, for me its ok. :D

 

 

AND, a very important thing!

 

in classes/order/OrderPayment.php

 

in this section: 

'order_reference' => 	array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 9),

change the 9 to 18 or more: like this.

'order_reference' => 	array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 18),

Great that this works for you, but as soon as you upgrade your Prestashop you will have a problem  :P above changes will be lost.

  • Like 2

Share this post


Link to post
Share on other sites

By the way...version 1.5.3 is almost done. Found and fixed the issue with date/time format (annoying regular expressions) but still not happy about the installation/upgrade of the module and the issues around the overrides. It needs a little bit more attention.

 

Since the current version probably also has problems with the installation, I would like to "manually" install the new version and try it with the date. Or how long does it take until the 1.5.3 is ready? Can we help?

 

Besides annoying your cookie law module on http://prestadev.nl/en/ and it can not be deactivated with me. Tested on Chrome & Firefox. Whenever I scroll down, it comes back ....

Edited by xMartin (see edit history)

Share this post


Link to post
Share on other sites

Since the current version probably also has problems with the installation, I would like to "manually" install the new version and try it with the date. Or how long does it take until the 1.5.3 is ready? Can we help?

 

Besides annoying your cookie law module on http://prestadev.nl/en/ and it can not be deactivated with me. Tested on Chrome & Firefox. Whenever I scroll down, it comes back ....

Sorry 'bout the cookie law module on my site, that one needs some re-work as well but can't seem to find the time to do so  :unsure:

I still need to debug the updatescript for 1.5.3, for some unknown reason the script fails so manual installation will only overwrite the current module installation and disable the module.

Share this post


Link to post
Share on other sites

[NL]


Order referentie wijzigings module v1.5.3 update


Wat is veranderd?


  • Bugfix op datum/tijd format voorvoegsel
  • Kleine bugfix op updatescript
  • Handmatige hook aanmaak en registratie script toegevoegd

Een groot aantal gebruikers, ong. 722, die met een geldig mailadres de module hebben gedownload van mijn site zullen in de komende uren een mail ontvangen met een rechtstreekse downloadlink naar de nieuwe update.


 


Voor alle anderen, zie https://www.dropbox.com/s/7kkhtgkrpq4h755/modrefchange.zip?dl=0


 


---


[EN]


Order reference change module v1.5.3 update


 


So, what has changed?


  • Bugfix on date/time format prefix
  • Minor bugfix on updatescript
  • Added manual hook creation and registration script

A large number of users, about 722, who have downloaded the module on my site using a valid email address will receive an email in the coming hours containing a direct download link for the new update.


 


For all others, see https://www.dropbox.com/s/7kkhtgkrpq4h755/modrefchange.zip?dl=0


Edited by scorpionsworld (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Hi!

 

Order reference change mod v1.5.3 - by PrestadevNL ('ve just downloaded and installed)

 

Presta 1.6.0.8. Options: Multishop (3 shops) + Advanced Stock Management.

 

Installed and configured the module in "All shops" mode.

 

Use Character(s) to prefix Order ID: %m_      //also tried %y%m%d //

But the result is:   %m_07_00010    but  needed:  07_00010   :(

Edited by AnatolyW (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites