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)
Link to comment
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)
Link to comment
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.

Link to comment
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
Link to comment
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)
Link to comment
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)
Link to comment
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)
Link to comment
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)
Link to comment
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)
Link to comment
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

Link to comment
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,

Link to comment
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.

Link to comment
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  <_<

Link to comment
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
Link to comment
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,

Link to comment
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.

Link to comment
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.

Link to comment
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:

Link to comment
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 ).

 

Link to comment
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

Link to comment
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
Link to comment
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)
Link to comment
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

Link to comment
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.

Link to comment
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
Link to comment
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)
Link to comment
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
Link to comment
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)
Link to comment
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.

Link to comment
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
Link to comment
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
Link to comment
Share on other sites

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 !!!!!

post-793608-0-76917400-1405256175_thumb.png

post-793608-0-00523300-1405256177_thumb.png

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

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

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

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 by brendonjohn (see edit history)
Link to comment
Share on other sites

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 by scorpionsworld (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
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

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

 

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

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

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 464

Notice: Trying to get property of non-object in /home/eingvdzq/public_html/modules/modrefchange/modrefchange.php on line 464

Warning: 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 464
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); } 
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

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

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 by templaries (see edit history)
Link to comment
Share on other sites

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

×
×
  • Create New...