nikmagnus Posted April 16, 2014 Share Posted April 16, 2014 Awesome, works great on PS 1.5.6.2 Thanks sooooo much. Link to comment Share on other sites More sharing options...
navid68 Posted April 28, 2014 Share Posted April 28, 2014 Hi, anyone tried this on PrestaShop 1.6? Thanks Navid Link to comment Share on other sites More sharing options...
navid68 Posted April 29, 2014 Share Posted April 29, 2014 Just tried in PrestaShop version 1.6.0.6 and it works fine Link to comment Share on other sites More sharing options...
hpaixao Posted May 11, 2014 Share Posted May 11, 2014 (edited) - 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 May 11, 2014 by hpaixao (see edit history) Link to comment Share on other sites More sharing options...
sightless Posted May 13, 2014 Share Posted May 13, 2014 Will this be able to match the Order # with the invoice # yet? Really need this feature. Great that it works on 1.6! Link to comment Share on other sites More sharing options...
scorpionsworld Posted May 13, 2014 Author Share Posted May 13, 2014 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) Link to comment Share on other sites More sharing options...
sightless Posted May 15, 2014 Share Posted May 15, 2014 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 haha. Link to comment Share on other sites More sharing options...
scorpionsworld Posted May 15, 2014 Author Share Posted May 15, 2014 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 haha. i won't suddenly charge for something that i've been offering for free all this time. 1 Link to comment Share on other sites More sharing options...
sightless Posted May 15, 2014 Share Posted May 15, 2014 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! Link to comment Share on other sites More sharing options...
frank de beer Posted June 13, 2014 Share Posted June 13, 2014 (edited) 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 June 13, 2014 by frank de beer (see edit history) Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 15, 2014 Author Share Posted June 15, 2014 (edited) [NL] Het is eindelijk gelukt! 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! 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 August 30, 2014 by scorpionsworld (see edit history) Link to comment Share on other sites More sharing options...
sightless Posted June 16, 2014 Share Posted June 16, 2014 Does this module work with 1.6.06? Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 16, 2014 Author Share Posted June 16, 2014 Does this module work with 1.6.06? Yes, it does Link to comment Share on other sites More sharing options...
azar9 Posted June 17, 2014 Share Posted June 17, 2014 Yes, it does modrefchange (parsing errors in /modules/modrefchange/modrefchange.php), modrefchange (class is missing in /modules/modrefchange/modrefchange.php) Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 17, 2014 Author Share Posted June 17, 2014 modrefchange (parsing errors in /modules/modrefchange/modrefchange.php), modrefchange (class is missing in /modules/modrefchange/modrefchange.php) No line numbers? I'll look into it. Seems it will need some debugging. Link to comment Share on other sites More sharing options...
matejmili Posted June 17, 2014 Share Posted June 17, 2014 i have prestashop 1.6.06 pleas look screnshoot sorry for my bad english Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 17, 2014 Author Share Posted June 17, 2014 i have prestashop 1.6.06 pleas look screnshoot sorry for my bad english You can try to reset/re-install the module Link to comment Share on other sites More sharing options...
matejmili Posted June 17, 2014 Share Posted June 17, 2014 I've tried. but does not resist. it may be because I have Croatian language? Link to comment Share on other sites More sharing options...
sightless Posted June 17, 2014 Share Posted June 17, 2014 Hello, I have the English version and also getting the above error. Thanks for any help! Link to comment Share on other sites More sharing options...
Allerganics Posted June 17, 2014 Share Posted June 17, 2014 Me too. Please help. Link to comment Share on other sites More sharing options...
Allerganics Posted June 17, 2014 Share Posted June 17, 2014 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 modrefchange (parse error in /modules/modrefchange/modrefchange.php) modrefchange (class missing in /modules/modrefchange/modrefchange.php) Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 18, 2014 Author Share Posted June 18, 2014 I will need to patch the module. An update will be posted asap, sorry for the inconvenience. Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 18, 2014 Author Share Posted June 18, 2014 (edited) [NL] Order referentie wijzigings module v1.5.1 update Wat is veranderd? Kleine bugfixEen 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 bugfixA 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 August 30, 2014 by scorpionsworld (see edit history) Link to comment Share on other sites More sharing options...
matejmili Posted June 18, 2014 Share Posted June 18, 2014 modrefchange : Error while adding hook actionBeforeAddOrderInvoice :-((( Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 18, 2014 Author Share Posted June 18, 2014 modrefchange : Error while adding hook actionBeforeAddOrderInvoice :-((( Check if the hook already exists in Backoffice->Modules->positions Link to comment Share on other sites More sharing options...
matejmili Posted June 18, 2014 Share Posted June 18, 2014 no is not instaled I can give them my password so they can check it when they have time. give me your email Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 18, 2014 Author Share Posted June 18, 2014 no is not instaled I can give them my password so they can check it when they have time. give me your email support[at]prestadev.nl or send me a pm Link to comment Share on other sites More sharing options...
oracle178 Posted June 18, 2014 Share Posted June 18, 2014 Hi, I have the same problem: The following module(s) were not installed properly: - modrefchange :Error while adding hook actionBeforeAddOrderInvoice I am useing 1.5.4.1 version Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 18, 2014 Author Share Posted June 18, 2014 I'm sorry to say, but it seems the installer still has issues although i've tested on several clean installs. A new bugfix still seems necessary Link to comment Share on other sites More sharing options...
azar9 Posted June 18, 2014 Share Posted June 18, 2014 1.6.0.6 modrefchange : Error while adding hook actionBeforeAddOrderInvoice Link to comment Share on other sites More sharing options...
djmortis Posted June 18, 2014 Share Posted June 18, 2014 The same problem in 1.6.0.6 Link to comment Share on other sites More sharing options...
dunozf Posted June 19, 2014 Share Posted June 19, 2014 The same problem in 1.6.0.6 Link to comment Share on other sites More sharing options...
zaxone Posted June 19, 2014 Share Posted June 19, 2014 Hi, Prestashop 1.5.6.1 Error while adding hook actionBeforeAddOrderInvoice Link to comment Share on other sites More sharing options...
ferhathome Posted June 19, 2014 Share Posted June 19, 2014 The same problem in 1.6.0.6 Link to comment Share on other sites More sharing options...
dunozf Posted June 20, 2014 Share Posted June 20, 2014 The same problem in 1.6.0.7 Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 20, 2014 Author Share Posted June 20, 2014 (edited) [NL] Order referentie wijzigings module v1.5.2 update Wat is veranderd? Kleine bugfix op de hook installatieEen 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 installerA 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 August 30, 2014 by scorpionsworld (see edit history) Link to comment Share on other sites More sharing options...
oracle178 Posted June 20, 2014 Share Posted June 20, 2014 I tried but nothing has changed, still getting the same error Link to comment Share on other sites More sharing options...
azar9 Posted June 20, 2014 Share Posted June 20, 2014 I tried but nothing has changed, still getting the same error modrefchange : Error while adding hook actionBeforeAddDeliveryNumber Link to comment Share on other sites More sharing options...
oracle178 Posted June 20, 2014 Share Posted June 20, 2014 - modrefchange :Error while adding hook actionBeforeAddOrderInvoice Link to comment Share on other sites More sharing options...
matejmili Posted June 20, 2014 Share Posted June 20, 2014 presta 16.0.6 can not install modrefchange : Error while adding hook actionBeforeAddOrderInvoice Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 20, 2014 Author Share Posted June 20, 2014 Link to comment Share on other sites More sharing options...
azar9 Posted June 20, 2014 Share Posted June 20, 2014 Double clicked on the install button and .... ..... aliluya .... module stood. PS 1.6.0.6 Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 20, 2014 Author Share Posted June 20, 2014 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 Link to comment Share on other sites More sharing options...
dunozf Posted June 20, 2014 Share Posted June 20, 2014 PS 1.6.0.7 - modrefchange 1.5.2 work without problems for me. Thanks Link to comment Share on other sites More sharing options...
zaxone Posted June 20, 2014 Share Posted June 20, 2014 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, Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 20, 2014 Author Share Posted June 20, 2014 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. Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 20, 2014 Author Share Posted June 20, 2014 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 Link to comment Share on other sites More sharing options...
matejmili Posted June 20, 2014 Share Posted June 20, 2014 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 Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 20, 2014 Author Share Posted June 20, 2014 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 Link to comment Share on other sites More sharing options...
zaxone Posted June 23, 2014 Share Posted June 23, 2014 Hifinally 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 IDThank you, Link to comment Share on other sites More sharing options...
engineerHopf Posted June 27, 2014 Share Posted June 27, 2014 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: 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. Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 27, 2014 Author Share Posted June 27, 2014 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. Link to comment Share on other sites More sharing options...
KevinNash Posted June 28, 2014 Share Posted June 28, 2014 - 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 Link to comment Share on other sites More sharing options...
KevinNash Posted June 28, 2014 Share Posted June 28, 2014 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 ). Link to comment Share on other sites More sharing options...
Stefand Posted June 30, 2014 Share Posted June 30, 2014 Hi, this module is not working with 1.6.0.8 please help. Install fine, configuration fine, butt still wrong references. Link to comment Share on other sites More sharing options...
engineerHopf Posted June 30, 2014 Share Posted June 30, 2014 And im trying and trying, but i can insert a date, please help . 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 Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 30, 2014 Author Share Posted June 30, 2014 Hi, this module is not working with 1.6.0.8 please help. Install fine, configuration fine, butt still wrong references. stefan, heb je ook de hooks gecontroleerd? Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 30, 2014 Author Share Posted June 30, 2014 And im trying and trying, but i can insert a date, please help . 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 1 Link to comment Share on other sites More sharing options...
xMartin Posted June 30, 2014 Share Posted June 30, 2014 (edited) 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 June 30, 2014 by xMartin (see edit history) Link to comment Share on other sites More sharing options...
engineerHopf Posted June 30, 2014 Share Posted June 30, 2014 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 Link to comment Share on other sites More sharing options...
xMartin Posted June 30, 2014 Share Posted June 30, 2014 (edited) OK, the Version from http://prestadev.nl/en/ works fine. Unfortunately, I have not yet figured out how this works with the date. Edited June 30, 2014 by xMartin (see edit history) Link to comment Share on other sites More sharing options...
engineerHopf Posted June 30, 2014 Share Posted June 30, 2014 OK, the Version from http://prestadev.nl/en/ works fine. Unfortunately, I have not yet figured out how this works with the date. Doesnt work... Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 30, 2014 Author Share Posted June 30, 2014 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? 1 Link to comment Share on other sites More sharing options...
scorpionsworld Posted June 30, 2014 Author Share Posted June 30, 2014 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. 2 Link to comment Share on other sites More sharing options...
Stefand Posted July 1, 2014 Share Posted July 1, 2014 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. Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 1, 2014 Author Share Posted July 1, 2014 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 Link to comment Share on other sites More sharing options...
engineerHopf Posted July 1, 2014 Share Posted July 1, 2014 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... Link to comment Share on other sites More sharing options...
engineerHopf Posted July 1, 2014 Share Posted July 1, 2014 (edited) 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 This will generate a code like this: SP20140701-123456. The final 6 numbers are random numbers, for me its ok. 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 July 1, 2014 by engineerHopf (see edit history) Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 2, 2014 Author Share Posted July 2, 2014 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 This will generate a code like this: SP20140701-123456. The final 6 numbers are random numbers, for me its ok. 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 above changes will be lost. 2 Link to comment Share on other sites More sharing options...
engineerHopf Posted July 2, 2014 Share Posted July 2, 2014 Great that this works for you, but as soon as you upgrade your Prestashop you will have a problem above changes will be lost. Yeap, that's i read, i talked with my client, and he's agreed about that... hehe Link to comment Share on other sites More sharing options...
xMartin Posted July 3, 2014 Share Posted July 3, 2014 (edited) 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 July 3, 2014 by xMartin (see edit history) Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 3, 2014 Author Share Posted July 3, 2014 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 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. Link to comment Share on other sites More sharing options...
Stefand Posted July 7, 2014 Share Posted July 7, 2014 I get it finally working in 1.6.0.8 when I deleted in cache/class_index.php It generates again that file, and it works. Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 8, 2014 Author Share Posted July 8, 2014 (edited) [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 August 30, 2014 by scorpionsworld (see edit history) 1 Link to comment Share on other sites More sharing options...
slollo Posted July 9, 2014 Share Posted July 9, 2014 I got the email but I can't download the module, I cant add my address in process order page. Thanks for your work. Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 11, 2014 Author Share Posted July 11, 2014 I got the email but I can't download the module, I cant add my address in process order page. Thanks for your work. Could you send me a PM with your email or email me at support[at]prestadev.nl Link to comment Share on other sites More sharing options...
AnatolyW Posted July 12, 2014 Share Posted July 12, 2014 (edited) 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 July 12, 2014 by AnatolyW (see edit history) 1 Link to comment Share on other sites More sharing options...
zaxone Posted July 12, 2014 Share Posted July 12, 2014 Same problem here i can't set date/time format. Can you give us some examples? Thank you, Link to comment Share on other sites More sharing options...
AnatolyW Posted July 13, 2014 Share Posted July 13, 2014 (edited) Wow! 1) Module is installed and configured. 2) Some test orders. 3) Some last orders are cancelled and deleted with deletion method: (/controllers/admin/AdminOrdersController.php added: $this->addRowAction('delete') 4) See the result in attachments below: (!) IT IS NOT THE ORDER IDs !!!!! Edited July 13, 2014 by AnatolyW (see edit history) Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 14, 2014 Author Share Posted July 14, 2014 Wow! 1) Module is installed and configured. 2) Some test orders. 3) Some last orders are cancelled and deleted with deletion method: (/controllers/admin/AdminOrdersController.php added: $this->addRowAction('delete') 4) See the result in attachments below: (!) IT IS NOT THE ORDER IDs !!!!! That is indeed a bug. Something I will have to take a look at. Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 14, 2014 Author Share Posted July 14, 2014 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 That's weird. Seems the prefix character is literally used and converted to date/time format. I will have to investigate how this is happening. Same problem here i can't set date/time format. Can you give us some examples? Thank you, Some examples that should work are %Y %m %d %H %i %s I have mainly tested this with %Y Link to comment Share on other sites More sharing options...
Sivo Posted July 16, 2014 Share Posted July 16, 2014 (edited) trying to install it on Prestashop 1.5.6.2, warns me with the following message: Error while adding hook actionBeforeAddDeliveryNumber Any clue? Thanks! Edited July 16, 2014 by Sivo (see edit history) Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 16, 2014 Author Share Posted July 16, 2014 trying to install it on Prestashop 1.5.6.2, warns me with the following message: Error while adding hook actionBeforeAddDeliveryNumber Any clue? Thanks! call /modules/modrefchange/setmodhook.php and try to install again Link to comment Share on other sites More sharing options...
Sivo Posted July 18, 2014 Share Posted July 18, 2014 When you say call, what do you mean exactly? Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 18, 2014 Author Share Posted July 18, 2014 (edited) When you say call, what do you mean exactly?As in, navigate your browser to the url [yourdomain]/modules/modrefchange/setmodhook.phpIts a little repair script i've created if and when default installation fails Edited July 18, 2014 by scorpionsworld (see edit history) Link to comment Share on other sites More sharing options...
Sivo Posted July 19, 2014 Share Posted July 19, 2014 Well, seems like the file is missing in your uploaded module (https://www.dropbox.com/s/0fens0r4jaudk1m/modrefchange.zip). Link to comment Share on other sites More sharing options...
brendonjohn Posted July 19, 2014 Share Posted July 19, 2014 (edited) Well, seems like the file is missing in your uploaded module (https://www.dropbox.com/s/0fens0r4jaudk1m/modrefchange.zip). Hey Sivo, I think scorpionsworld may have mistyped. After running /modules/modrefchange/modrefchange.php through the browser, i was able to install the module as expected. This is for a store that's running 1.6.0.8. *edit* What I didn't check though, was if the module actually does what I expect it to. Despite the hooks being created, this doesn't appear to work. Edited July 19, 2014 by brendonjohn (see edit history) Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 19, 2014 Author Share Posted July 19, 2014 (edited) Well, seems like the file is missing in your uploaded module (https://www.dropbox.com/s/0fens0r4jaudk1m/modrefchange.zip). that's correct as the dropbox file was not the newest version. Download again and try to install the module again, if you still get an error about a hook not being added call the repairscript. Edited July 19, 2014 by scorpionsworld (see edit history) Link to comment Share on other sites More sharing options...
Sivo Posted July 19, 2014 Share Posted July 19, 2014 Works pretty fine! Thanks scorpionsworld Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 19, 2014 Author Share Posted July 19, 2014 Works pretty fine! Thanks scorpionsworld you're welcom Link to comment Share on other sites More sharing options...
itsy Posted July 30, 2014 Share Posted July 30, 2014 Hi, I have redownloaded, stalled and configured the modulev1.5.3, but it is not working on my prestashop 1.6.0.8. Please advice. Link to comment Share on other sites More sharing options...
tony.vvvv Posted July 31, 2014 Share Posted July 31, 2014 just modify the file classes/order/order.php line 1385 public static function generateReference() { return strtoupper(Tools::passwdGen(9, 'NO_NUMERIC')); } ============> public static function generateReference() { return Db::getInstance()->getValue('SELECT CONCAT("4",(MAX(id_order)+1)) FROM '._DB_PREFIX_.'orders'); } "4" is prefix. than the order id will like this: 4123,4456 Link to comment Share on other sites More sharing options...
tony.vvvv Posted July 31, 2014 Share Posted July 31, 2014 like this : Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 31, 2014 Author Share Posted July 31, 2014 Hi, I have redownloaded, stalled and configured the modulev1.5.3, but it is not working on my prestashop 1.6.0.8. Please advice. What exactly is not working? Is the reference not changed completely? If so, check if the module is hooked using the Modules->Positions page. Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 31, 2014 Author Share Posted July 31, 2014 just modify the file classes/order/order.php line 1385 public static function generateReference() { return strtoupper(Tools::passwdGen(9, 'NO_NUMERIC')); } ============> public static function generateReference() { return Db::getInstance()->getValue('SELECT CONCAT("4",(MAX(id_order)+1)) FROM '._DB_PREFIX_.'orders'); } "4" is prefix. than the order id will like this: 4123,4456 That's a simple fix, thanks. But not very usefull when you upgrade Prestashop. All changes will then be lost. Link to comment Share on other sites More sharing options...
templaries Posted July 31, 2014 Share Posted July 31, 2014 Nice module, but it does not work for me. I am on Prestashop 1.5.6.2 When I install the module, not error is shown, however when I go to the orders page in the backend I see this on the top of the page: public function add($autodate = true, $null_values = true) { $cart = new Cart($this->id_cart); Hook::exec('actionBeforeAddOrder', array('order'=>$this,'cart'=>$cart)); if (ObjectModel::add($autodate, $null_values)) return SpecificPrice::deleteByIdCart($this->id_cart); return false; } public static function setLastInvoiceNumber($order_invoice_id, $id_shop) { if (!$order_invoice_id) return false; $number = Configuration::get('PS_INVOICE_START_NUMBER', null, null, $id_shop); // If invoice start number has been set, you clean the value of this configuration if ($number) Configuration::updateValue('PS_INVOICE_START_NUMBER', false, false, null, $id_shop); $order_invoice = new OrderInvoice($order_invoice_id); $order = new Order($order_invoice->id_order); $cart = new Cart($order->id_cart); if($ref = Hook::exec('actionBeforeAddOrderInvoice', array('order_invoice'=>$order_invoice,'order'=>$order,'cart'=>$cart))) $number = $ref; $sql = 'UPDATE `'._DB_PREFIX_.'order_invoice` SET number ='; if ($number) $sql .= (int)$number; else $sql .= '(SELECT new_number FROM (SELECT (MAX(`number`) + 1) AS new_number FROM `'._DB_PREFIX_.'order_invoice`) AS result)'; $sql .=' WHERE `id_order_invoice` = '.(int)$order_invoice_id; return Db::getInstance()->execute($sql); } public function setDeliveryNumber($order_invoice_id, $id_shop) { if (!$order_invoice_id) return false; $number = Configuration::get('PS_DELIVERY_NUMBER', null, null, $id_shop); // If invoice start number has been set, you clean the value of this configuration if ($number) Configuration::updateValue('PS_DELIVERY_NUMBER', false, false, null, $id_shop); $order_invoice = new OrderInvoice($order_invoice_id); $order = new Order($order_invoice->id_order); $cart = new Cart($order->id_cart); if($ref = Hook::exec('actionBeforeAddDeliveryNumber', array('order'=>$order,'cart'=>$cart,'number'=>$number))) $number = $ref; $sql = 'UPDATE `'._DB_PREFIX_.'order_invoice` SET delivery_number ='; if ($number) $sql .= (int)$number; else $sql .= '(SELECT new_number FROM (SELECT (MAX(`delivery_number`) + 1) AS new_number FROM `'._DB_PREFIX_.'order_invoice`) AS result)'; $sql .=' WHERE `id_order_invoice` = '.(int)$order_invoice_id; return Db::getInstance()->execute($sql); } [here the header of the back end and so on] Please, what can i do. I tried to do this: [mydomain]/modules/modrefchange/setmodhook.php But the error persist. Also, I have got orders with 1.5 reference (like HUZNJGYHD). Thank you Link to comment Share on other sites More sharing options...
templaries Posted July 31, 2014 Share Posted July 31, 2014 Now, I can't unnistall from the back end. This error is shown:; Notice: Undefined variable: object in /home/eingvdzq/public_html/modules/modrefchange/modrefchange.php on line 464Notice: Trying to get property of non-object in /home/eingvdzq/public_html/modules/modrefchange/modrefchange.php on line 464Warning: copy(/home/eingvdzq/public_html/modules//override/classes/order/OrderPayment.php): failed to open stream: No such file or directory in/home/eingvdzq/public_html/modules/modrefchange/modrefchange.php on line 464public function add($autodate = true, $null_values = true) { $cart = new Cart($this->id_cart); Hook::exec('actionBeforeAddOrder', array('order'=>$this,'cart'=>$cart)); if (ObjectModel::add($autodate, $null_values)) return SpecificPrice::deleteByIdCart($this->id_cart); return false; } public static function setLastInvoiceNumber($order_invoice_id, $id_shop) public function add($autodate = true, $null_values = true) { $cart = new Cart($this->id_cart); Hook::exec('actionBeforeAddOrder', array('order'=>$this,'cart'=>$cart)); if (ObjectModel::add($autodate, $null_values)) return SpecificPrice::deleteByIdCart($this->id_cart); return false; } public static function setLastInvoiceNumber($order_invoice_id, $id_shop) { if (!$order_invoice_id) return false; $number = Configuration::get('PS_INVOICE_START_NUMBER', null, null, $id_shop); // If invoice start number has been set, you clean the value of this configuration if ($number) Configuration::updateValue('PS_INVOICE_START_NUMBER', false, false, null, $id_shop); $order_invoice = new OrderInvoice($order_invoice_id); $order = new Order($order_invoice->id_order); $cart = new Cart($order->id_cart); if($ref = Hook::exec('actionBeforeAddOrderInvoice', array('order_invoice'=>$order_invoice,'order'=>$order,'cart'=>$cart))) $number = $ref; $sql = 'UPDATE `'._DB_PREFIX_.'order_invoice` SET number ='; if ($number) $sql .= (int)$number; else $sql .= '(SELECT new_number FROM (SELECT (MAX(`number`) + 1) AS new_number FROM `'._DB_PREFIX_.'order_invoice`) AS result)'; $sql .=' WHERE `id_order_invoice` = '.(int)$order_invoice_id; return Db::getInstance()->execute($sql); } public function setDeliveryNumber($order_invoice_id, $id_shop) { if (!$order_invoice_id) return false; $number = Configuration::get('PS_DELIVERY_NUMBER', null, null, $id_shop); // If invoice start number has been set, you clean the value of this configuration if ($number) Configuration::updateValue('PS_DELIVERY_NUMBER', false, false, null, $id_shop); $order_invoice = new OrderInvoice($order_invoice_id); $order = new Order($order_invoice->id_order); $cart = new Cart($order->id_cart); if($ref = Hook::exec('actionBeforeAddDeliveryNumber', array('order'=>$order,'cart'=>$cart,'number'=>$number))) $number = $ref; $sql = 'UPDATE `'._DB_PREFIX_.'order_invoice` SET delivery_number ='; if ($number) $sql .= (int)$number; else $sql .= '(SELECT new_number FROM (SELECT (MAX(`delivery_number`) + 1) AS new_number FROM `'._DB_PREFIX_.'order_invoice`) AS result)'; $sql .=' WHERE `id_order_invoice` = '.(int)$order_invoice_id; return Db::getInstance()->execute($sql); } { if (!$order_invoice_id) return false; $number = Configuration::get('PS_INVOICE_START_NUMBER', null, null, $id_shop); // If invoice start number has been set, you clean the value of this configuration if ($number) Configuration::updateValue('PS_INVOICE_START_NUMBER', false, false, null, $id_shop); $order_invoice = new OrderInvoice($order_invoice_id); $order = new Order($order_invoice->id_order); $cart = new Cart($order->id_cart); if($ref = Hook::exec('actionBeforeAddOrderInvoice', array('order_invoice'=>$order_invoice,'order'=>$order,'cart'=>$cart))) $number = $ref; $sql = 'UPDATE `'._DB_PREFIX_.'order_invoice` SET number ='; if ($number) $sql .= (int)$number; else $sql .= '(SELECT new_number FROM (SELECT (MAX(`number`) + 1) AS new_number FROM `'._DB_PREFIX_.'order_invoice`) AS result)'; $sql .=' WHERE `id_order_invoice` = '.(int)$order_invoice_id; return Db::getInstance()->execute($sql); } public function setDeliveryNumber($order_invoice_id, $id_shop) { if (!$order_invoice_id) return false; $number = Configuration::get('PS_DELIVERY_NUMBER', null, null, $id_shop); // If invoice start number has been set, you clean the value of this configuration if ($number) Configuration::updateValue('PS_DELIVERY_NUMBER', false, false, null, $id_shop); $order_invoice = new OrderInvoice($order_invoice_id); $order = new Order($order_invoice->id_order); $cart = new Cart($order->id_cart); if($ref = Hook::exec('actionBeforeAddDeliveryNumber', array('order'=>$order,'cart'=>$cart,'number'=>$number))) $number = $ref; $sql = 'UPDATE `'._DB_PREFIX_.'order_invoice` SET delivery_number ='; if ($number) $sql .= (int)$number; else $sql .= '(SELECT new_number FROM (SELECT (MAX(`delivery_number`) + 1) AS new_number FROM `'._DB_PREFIX_.'order_invoice`) AS result)'; $sql .=' WHERE `id_order_invoice` = '.(int)$order_invoice_id; return Db::getInstance()->execute($sql); } Warning: Cannot modify header information - headers already sent by (output started at /home/eingvdzq/public_html/modules/modrefchange/modrefchange.php:464) in /home/eingvdzq/public_html/classes/Tools.phpon line 141 Link to comment Share on other sites More sharing options...
templaries Posted July 31, 2014 Share Posted July 31, 2014 I deleted the directory from the modules, and now i see this code on the top of order page (backend). Really bad experience on this modulo, what can i do? Thank you. public function add($autodate = true, $null_values = true) { $cart = new Cart($this->id_cart); Hook::exec('actionBeforeAddOrder', array('order'=>$this,'cart'=>$cart)); if (ObjectModel::add($autodate, $null_values)) return SpecificPrice::deleteByIdCart($this->id_cart); return false; } public static function setLastInvoiceNumber($order_invoice_id, $id_shop) public function add($autodate = true, $null_values = true) { $cart = new Cart($this->id_cart); Hook::exec('actionBeforeAddOrder', array('order'=>$this,'cart'=>$cart)); if (ObjectModel::add($autodate, $null_values)) return SpecificPrice::deleteByIdCart($this->id_cart); return false; } public static function setLastInvoiceNumber($order_invoice_id, $id_shop) { if (!$order_invoice_id) return false; $number = Configuration::get('PS_INVOICE_START_NUMBER', null, null, $id_shop); // If invoice start number has been set, you clean the value of this configuration if ($number) Configuration::updateValue('PS_INVOICE_START_NUMBER', false, false, null, $id_shop); $order_invoice = new OrderInvoice($order_invoice_id); $order = new Order($order_invoice->id_order); $cart = new Cart($order->id_cart); if($ref = Hook::exec('actionBeforeAddOrderInvoice', array('order_invoice'=>$order_invoice,'order'=>$order,'cart'=>$cart))) $number = $ref; $sql = 'UPDATE `'._DB_PREFIX_.'order_invoice` SET number ='; if ($number) $sql .= (int)$number; else $sql .= '(SELECT new_number FROM (SELECT (MAX(`number`) + 1) AS new_number FROM `'._DB_PREFIX_.'order_invoice`) AS result)'; $sql .=' WHERE `id_order_invoice` = '.(int)$order_invoice_id; return Db::getInstance()->execute($sql); } public function setDeliveryNumber($order_invoice_id, $id_shop) { if (!$order_invoice_id) return false; $number = Configuration::get('PS_DELIVERY_NUMBER', null, null, $id_shop); // If invoice start number has been set, you clean the value of this configuration if ($number) Configuration::updateValue('PS_DELIVERY_NUMBER', false, false, null, $id_shop); $order_invoice = new OrderInvoice($order_invoice_id); $order = new Order($order_invoice->id_order); $cart = new Cart($order->id_cart); if($ref = Hook::exec('actionBeforeAddDeliveryNumber', array('order'=>$order,'cart'=>$cart,'number'=>$number))) $number = $ref; $sql = 'UPDATE `'._DB_PREFIX_.'order_invoice` SET delivery_number ='; if ($number) $sql .= (int)$number; else $sql .= '(SELECT new_number FROM (SELECT (MAX(`delivery_number`) + 1) AS new_number FROM `'._DB_PREFIX_.'order_invoice`) AS result)'; $sql .=' WHERE `id_order_invoice` = '.(int)$order_invoice_id; return Db::getInstance()->execute($sql); } { if (!$order_invoice_id) return false; $number = Configuration::get('PS_INVOICE_START_NUMBER', null, null, $id_shop); // If invoice start number has been set, you clean the value of this configuration if ($number) Configuration::updateValue('PS_INVOICE_START_NUMBER', false, false, null, $id_shop); $order_invoice = new OrderInvoice($order_invoice_id); $order = new Order($order_invoice->id_order); $cart = new Cart($order->id_cart); if($ref = Hook::exec('actionBeforeAddOrderInvoice', array('order_invoice'=>$order_invoice,'order'=>$order,'cart'=>$cart))) $number = $ref; $sql = 'UPDATE `'._DB_PREFIX_.'order_invoice` SET number ='; if ($number) $sql .= (int)$number; else $sql .= '(SELECT new_number FROM (SELECT (MAX(`number`) + 1) AS new_number FROM `'._DB_PREFIX_.'order_invoice`) AS result)'; $sql .=' WHERE `id_order_invoice` = '.(int)$order_invoice_id; return Db::getInstance()->execute($sql); } public function setDeliveryNumber($order_invoice_id, $id_shop) { if (!$order_invoice_id) return false; $number = Configuration::get('PS_DELIVERY_NUMBER', null, null, $id_shop); // If invoice start number has been set, you clean the value of this configuration if ($number) Configuration::updateValue('PS_DELIVERY_NUMBER', false, false, null, $id_shop); $order_invoice = new OrderInvoice($order_invoice_id); $order = new Order($order_invoice->id_order); $cart = new Cart($order->id_cart); if($ref = Hook::exec('actionBeforeAddDeliveryNumber', array('order'=>$order,'cart'=>$cart,'number'=>$number))) $number = $ref; $sql = 'UPDATE `'._DB_PREFIX_.'order_invoice` SET delivery_number ='; if ($number) $sql .= (int)$number; else $sql .= '(SELECT new_number FROM (SELECT (MAX(`delivery_number`) + 1) AS new_number FROM `'._DB_PREFIX_.'order_invoice`) AS result)'; $sql .=' WHERE `id_order_invoice` = '.(int)$order_invoice_id; return Db::getInstance()->execute($sql); } Link to comment Share on other sites More sharing options...
templaries Posted July 31, 2014 Share Posted July 31, 2014 (edited) Then, to try to remove the impact of the plugin, I have delete the files created in override folder for this plugin, but the error is still in the backend. EDIT: Ok. I had renamed not deleted, now I am delete the files created by the plugin (located in override folder) and the I remove all the cache. The error is gone. Edited July 31, 2014 by templaries (see edit history) Link to comment Share on other sites More sharing options...
scorpionsworld Posted July 31, 2014 Author Share Posted July 31, 2014 Then, to try to remove the impact of the plugin, I have delete the files created in override folder for this plugin, but the error is still in the backend. EDIT: Ok. I had renamed not deleted, now I am delete the files created by the plugin (located in override folder) and the I remove all the cache. The error is gone. Obviously something went terribly wrong with the installation and uninstallation of the overrides on your PS installation. Sadly enough the installation of overrides from modules is far from perfect and can in some cases cause software breaking errors. The only solution is to manually install/upload or merge the overrides from the module zip content to the root override folder and then manually upload the module folder (in this case the modrefchange folder) from the zip file to the modules folder of the root PS installation, delete the override folder within the module's folder and install the module through the backend. That way, automatic installation of the override is skipped. Link to comment Share on other sites More sharing options...
Recommended Posts