berta recchia Posted April 6, 2011 Share Posted April 6, 2011 I'm having a serious issue with Invoices. Neither I nor the customers can view ANY invoice.When I click on one I get "Fatal Error" and a blank page.With error checing enabled I get this:"Notice: Undefined variable: invoice_address in /home/anticoelements/public_html/classes/PDF.php on line 402 Notice: Trying to get property of non-object in /home/anticoelements/public_html/classes/PDF.php on line 402 Notice: Undefined variable: invoice_address in /home/anticoelements/public_html/classes/PDF.php on line 423 Notice: Trying to get property of non-object in /home/anticoelements/public_html/classes/PDF.php on line 423 Notice: Undefined variable: invoice_address in /home/anticoelements/public_html/classes/PDF.php on line 423"We modified PDF.php a long time ago and it all worked until today. We put the original PDF.php back and the problem is still coming up.We can't figure out what it could be!Any suggestion? Link to comment Share on other sites More sharing options...
tomerg3 Posted April 6, 2011 Share Posted April 6, 2011 What version of Prestashop are you using?Are you sure you copied the original file?Did you change any other core files? Link to comment Share on other sites More sharing options...
berta recchia Posted April 6, 2011 Author Share Posted April 6, 2011 Version 1.4.0.17.Yes it's the original file.We changed other file since we made modifications to the site, it's not out of the box. What do you mean by core files? Link to comment Share on other sites More sharing options...
tomerg3 Posted April 6, 2011 Share Posted April 6, 2011 did you change anything in the classes or controller folders? Link to comment Share on other sites More sharing options...
erotikat Posted April 11, 2011 Share Posted April 11, 2011 Hello,I am currently testing the migration of my shop in Version 1.3.1.1 Version 1.4.0.17.The PDF invoice generation works fine when I do a clean install (no update).But when I make update I can no longer edit the invoices listed BO as the client side FO, while vouchers work quite well.I get this message:"Fatal Error" in a beautiful blank pageI enabled Verbose errors and in fact it blocks the function:Class / Cart.php: getTaxesAverageUsed $cart = new Cart((int)($id_cart)); if (!Validate::isLoadedObject($cart)) die(Tools::displayError()); I think it can not create a cart for the calculation of the bill, but why? If I replace the modules and the classes directory works (clean install) on the one that does not work (installed with update) I have the same error message?There would not be a problem on the update of the database?PS : Sorry for my english :red: Link to comment Share on other sites More sharing options...
berta recchia Posted April 11, 2011 Author Share Posted April 11, 2011 Yes, that's where the problem is. It's the information in the cart. If somehow we lose the cart info, the invoices are the cannot be viewed.I had to delete some carts manually because my UPS module pukes when some1 puts a lot of products in his carts and it slows down the whole site until thoese carts are deleted. Those invices are sadly gone. Very strange way to gather info for an invoce of an order already submitted.Thanks. Link to comment Share on other sites More sharing options...
erotikat Posted April 11, 2011 Share Posted April 11, 2011 if I generate a new command I can edit the invoice (BO and FO) but not on older ...There's not a bug there?Can anyone confirm ?Why nobody are not solve this issue.... Link to comment Share on other sites More sharing options...
erotikat Posted April 11, 2011 Share Posted April 11, 2011 if I generate a new command I can edit the invoice (BO and FO) but not on older ... There's not a bug there? Can anyone confirm ? Why nobody not solved this issue ? twice post to delete ..... Link to comment Share on other sites More sharing options...
tomerg3 Posted April 11, 2011 Share Posted April 11, 2011 You can check to see if it was reported in the bug tracker, and if not, report it there, the PS team usually responds and fixes them pretty quickly. Link to comment Share on other sites More sharing options...
erotikat Posted April 11, 2011 Share Posted April 11, 2011 i do not see it in the tracker but i'm french so perhaps i do not search correctly....i don't have any report in french forum.i check the difference between the old invoice and the new one to see if i found something. Link to comment Share on other sites More sharing options...
erotikat Posted April 11, 2011 Share Posted April 11, 2011 I think to have found sometyhing :gulp: If i delete the cart, in the table ps_cart, corresponding of my order I have the same error "Fatal error" :snake: if i change the id_cart corresponding at an older order I can show the invoice ;-P So before this version if you delete the cart existing in the ps_cart you do not have any error to print the invoice.I think it can not be recreate the cart to calculate the content.If you can help me to solve this issue about classes/Cart.php static public function getTaxesAverageUsed($id_cart) { $cart = new Cart((int)($id_cart)); if (!Validate::isLoadedObject($cart)) die(Tools::displayError()); if (!Configuration::get('PS_TAX')) return 0; $products = $cart->getProducts(); $totalProducts_moy = 0; $ratioTax = 0; if (!sizeof($products)) return 0; foreach ($products AS $product) { $totalProducts_moy += $product['total_wt']; $ratioTax += $product['total_wt'] * Tax::getProductTaxRate((int)$product['id_product'], (int)$cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); } if ($totalProducts_moy > 0) return $ratioTax / $totalProducts_moy; return 0; } because if i comment this to line it's work well (but i don't if it's correct) //if (!Validate::isLoadedObject($cart)) // die(Tools::displayError()); Link to comment Share on other sites More sharing options...
berta recchia Posted April 11, 2011 Author Share Posted April 11, 2011 I think to have found sometyhing :gulp: if i change the id_cart corresponding at an older order I can show the invoice ;-P [/code] Where do you change the cart id? Which table? I tried to change the id_cart in table ps_orders for one order. I tried different numbers but I still can't view the invoice for that order.Am I missing something?Thanks. Link to comment Share on other sites More sharing options...
erotikat Posted April 12, 2011 Share Posted April 12, 2011 In the ps_order table you have a column named id_cart. So you take the number correcponding of your order and change the number, in the ps_cart table, of a existing cart with the value taking just before, in the column id_cart.And now you can edit the invoice corresponding of your order. Link to comment Share on other sites More sharing options...
berta recchia Posted April 13, 2011 Author Share Posted April 13, 2011 Wow it works. I can't change another order's cart number because then I can't view the invoice for that second cart.What works is to copy an empty cart and change the id_cart number with the value from the ps_orders.Thanks! Link to comment Share on other sites More sharing options...
erotikat Posted December 19, 2011 Share Posted December 19, 2011 Hi, You can use another solution where it's post here (in french) http://www.prestashop.com/forums/topic/115487-resolu-fatal-error-dans-le-menu-factures/page__fromsearch__1 I use this one and not commented the die line 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