Jump to content

[SOLVED] Customer order confirmation email - links "Order history", "my account" not working


Recommended Posts

Hello guys, please I need some help again. i dont really know where to put this, hope I`m in the right thread. So.

 

i am almost finished with my webshop, only minor details missing. One of these is the links from the order confirmation email footer, which is received by the customer. There are two links, Order History and My account. None of these works, returns following error: 

 

Warning: File /home/salus/public_html/history.php is deprecated
in /home/salus/public_html/classes/Tools.php on line 2137

Warning: Cannot modify header information - headers already sent by (output started at /home/salus/public_html/classes/Tools.php:2137) in /home/salus/public_html/classes/Tools.php on line 105

Warning: Cannot modify header information - headers already sent by (output started at /home/salus/public_html/classes/Tools.php:2137) in /home/salus/public_html/classes/Tools.php on line 108

 

Any ideeas how to fix this? temporarily I could take out those links form the email template, but that is not real solution. Unfortunately I dont speak php just as I dont speak chinese, so a little bit of help is more than wellcome :)

 

But in that history.php i noticed saying in english (which I mostly understand):

This file will be removed in 1.6
 * You have to use index.php?controller=page_name instead of this page
 *
 * @deprecated 1.5.0
 */


require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();


Tools::redirect('index.php?controller=history'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

I use prestashop 1.5.6  - and I do NOT afford any upgrade, since my version is so heavily patched and tinkered and personalized that I always wonder it still works...  I had some modules updated and personalized, but the core is 1.5.6, with translations done all by myself.

So I guess that the line in red above sounds discouraging, aint? Any ideeas?

 

I will send any files to anyone asks, if needed, and I will also let the shop online for the night, you can try it if you want. www.salus-tehnomed.ro

Thanks in advance for the help.

 

Salus

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

Hi Salus,

 

I searched on the "Cannot modify header information" error and sounds like that is caused by either white space inadvertently added in there or a utf-8 problem. These are both explained in this thread (the white space error is near the bottom at post #16):

http://www.prestashop.com/forums/topic/84689-solved-help-shop-shows-blank-pages/

 

Check to see if your Tools.php near line 2137 has the white space problem.

 

Link to comment
Share on other sites

Thanks a lot for looking into it, osdznr14mm (took me some time to spell your name :))

 

Well, here it is the line 2137 and it`s surroundings from tool.php:

 

protected static function throwDeprecated($error, $message, $class)
{
if (_PS_DISPLAY_COMPATIBILITY_WARNING_)
{
trigger_error($error,E_USER_WARNING);<----this is line 2137
Logger::addLog($message,3,$class);
}
}

I cannot see any white spaces, no empty lines. I opened it with notepad++, even deleted every SPACE characters form the whole function, but I still get the same error. Maybe my comprehension of this white space problem is lacking?

 

But the whole function refers to something as DEPRECATED... As far as I can understand, this section only tells the webserver which error message has to be generated and thrown at me if ... the question is IF WHAT? I am looking for the IF WHAT.

 

On the other hand, I looked into the second part of the error message, line 105, and there was an empty line, but I dont think it was a processable empty line, it looked like this:

if ($headers)
{
if (!is_array($headers))
$headers = array($headers);

                                  <----empty line at 105
foreach ($headers as $header)
header($header);
}
header('Location: '.$url);
exit;
}

I deleted that empty line (against my conviction, I still dont think it has any processable information since both if above and foreach below are properly closed - but I am no programmer, as I said), and saved.

Clicking the link gave me the same error, just that this time it changed the lines, like this:

Warning: File /home/salus/public_html/history.php is deprecated
in /home/salus/public_html/classes/Tools.php on line 2137

Warning: Cannot modify header information - headers already sent by (output started at /home/salus/public_html/classes/Tools.php:2137) in /home/salus/public_html/classes/Tools.php on line 105

Warning: Cannot modify header information - headers already sent by (output started at /home/salus/public_html/classes/Tools.php:2137) in /home/salus/public_html/classes/Tools.php on line 108
Edited by Salus (see edit history)
Link to comment
Share on other sites

you should disable debug_mode and then you will not see warning messages.  It is working as it was designed to work. 

 

Thank you, bellini13, you are a genius  - and I am embarassed :) I disabled debug mode and now all the links are working fine. 

 

(Side NOTE: I don`t remember me enabling debug mode, since I didn`t know how to do it. I had to search on forum to find out how to edit defines.inc.php, and the file was in it`s original state. It must have been enabled by default, I guess. or not?)

 

Anyway, it doesnt matter anymore, important is that now works fine. Thank you for the solution, Bellini13.

Link to comment
Share on other sites

no problem.  perhaps you had a freelancer work on your site or assist you and they enabled it?

No, for sure I am the only one working on this site. But could be the server administrator, the guy that installed and configured the prestashop native on the server. 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...