Profillageret.dk Posted October 27, 2015 Share Posted October 27, 2015 Hello Forum, I really hope some of you can help me. I just updated my shop from 1.6.0.14 to 1.6.1.1 through the 1-click installer. All went fine. But now I see some errors in the backoffice. When I am on a order an click documents and delivery slip or invoice, I get these errors: Fatal error: Call to undefined method OrderInvoice::getCurrentFormattedShopAddress() in /home/profilla/public_html/classes/pdf/HTMLTemplateDeliverySlip.php on line 49 Fatal error: Call to undefined method OrderInvoice::getCurrentFormattedShopAddress() in /home/profilla/public_html/classes/pdf/HTMLTemplateInvoice.php on line 51 This all worked fine before the upgrade... Anyone with an idea how to fix it ? Thanks. Link to comment Share on other sites More sharing options...
tuk66 Posted October 28, 2015 Share Posted October 28, 2015 Check the /classes/order/OrderInvoice.php file. Is from 1.6.1.1? Link to comment Share on other sites More sharing options...
Profillageret.dk Posted October 28, 2015 Author Share Posted October 28, 2015 Hello tuk66, It looks like it is, and in the bottom of that file I also find this function: /** * This method is used to fix shop addresses that cannot be fixed during upgrade process * (because uses the whole environnement of PS classes that is not available during upgrade). * This method should execute once on an upgraded PrestaShop to fix all OrderInvoices in one shot. * This method is triggered once during a (non bulk) creation of a PDF from an OrderInvoice that is not fixed yet. * * @since 1.6.1.1 */ public static function fixAllShopAddresses() { $shop_ids = Shop::getShops(false, null, true); $db = Db::getInstance(); foreach($shop_ids as $id_shop) { $address = self::getCurrentFormattedShopAddress($id_shop); $escaped_address = $db->escape($address, true, true); $db->execute('UPDATE `'._DB_PREFIX_.'order_invoice` INNER JOIN `'._DB_PREFIX_.'orders` USING (`id_order`) SET `shop_address` = \''.$escaped_address.'\' WHERE `shop_address` IS NULL AND `id_shop` = '.$id_shop); } } } I dont think this function has been run yet... how do I force it to run ? Because in the file which makes the error, I find this code: // If shop_address is null, then update it with current one. // But no DB save required here to avoid massive updates for bulk PDF generation case. // (DB: bug fixed in 1.6.1.1 with upgrade SQL script to avoid null shop_address in old orderInvoices) if (!isset($this->order_invoice->shop_address) || !$this->order_invoice->shop_address) { $this->order_invoice->shop_address = OrderInvoice::getCurrentFormattedShopAddress((int)$this->order->id_shop); if (!$bulk_mode) { OrderInvoice::fixAllShopAddresses(); } } Link to comment Share on other sites More sharing options...
tuk66 Posted October 28, 2015 Share Posted October 28, 2015 What about /cache/class_index.php. How is OrderInvoice mentioned? Link to comment Share on other sites More sharing options...
Profillageret.dk Posted October 28, 2015 Author Share Posted October 28, 2015 I find this: 'OrderInvoice' => array ( 'path' => '', 'type' => 'class', 'override' => false, ), 'OrderInvoiceCore' => array ( 'path' => 'override/classes/order/OrderInvoice.php', 'type' => 'class', 'override' => false, ), Link to comment Share on other sites More sharing options...
tuk66 Posted October 28, 2015 Share Posted October 28, 2015 I've seen something similar. Strange. It should be: 'OrderInvoice' => array ( 'path' => 'override/classes/order/OrderInvoice.php', 'type' => 'class', 'override' => false, ), 'OrderInvoiceCore' => array ( 'path' => 'classes/order/OrderInvoice.php', 'type' => 'class', 'override' => false, ), Fix it or remove the file and it will be recreated (let's hope). Link to comment Share on other sites More sharing options...
Profillageret.dk Posted October 28, 2015 Author Share Posted October 28, 2015 I tried to remove the file... It got recreated again, but with the same errors.Then I tried to change it according to your instructions, and when I try to click on an order, i get a "servererror 500" ?? I am willing to pay you, if you can fix it for me, and if you like, we can take it through Skype chat, and post the solution here ? Thanks. Link to comment Share on other sites More sharing options...
tuk66 Posted October 28, 2015 Share Posted October 28, 2015 Please PM or better chat at presta-addons.com. I'm sure I can fix it. Link to comment Share on other sites More sharing options...
Profillageret.dk Posted October 28, 2015 Author Share Posted October 28, 2015 PM your way Link to comment Share on other sites More sharing options...
TeapotDan Posted January 6, 2016 Share Posted January 6, 2016 Has there been a solution to this please? Link to comment Share on other sites More sharing options...
Profillageret.dk Posted January 7, 2016 Author Share Posted January 7, 2016 Has there been a solution to this please? Hello TeapotDan, I dont remember the solution... But I got tuk66 to fix it, through his company. http://www.presta-addons.com/en/ Contact him through his chat on the website. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now