Page 1 of 1

Comments not posting to Order Confirmation email

Posted: Thu Mar 13, 2025 5:48 pm
by otgrouch
1.0.9.9 store running php 8.3.17

Recently migrated from osc 2.3.4.1 CE

When an order is placed, the order confirmation email is not listing the order comments. The comments are posting to the db and show in the order history. Looking at tpl_n_checkout.php, the code looks very similar to the code used in CE (a few changes, presumably to account for php updates)...but the comments were posting to the email in CE.

Relevant Phoenix code:
if (!empty($order->info['comments'])) {
echo htmlspecialchars($order->info['comments']) . "\n";

Previous OSC code:
if ($order->info['comments']) {
$email_order .= tep_db_output($order->info['comments']) . "\n\n";


The only change I can see in the process is that previously the comments block was listed on every step of the checkout process with a text of the comments on the confirmation page, while the new way has the comment entry block only on the confirmation page.

I found this thread that seems to be pointing to the same issue, but there was no resolution.

viewtopic.php?f=10&t=848&p=6409&hilit=c ... ents#p6409

Thank you for any input.

Re: Comments not posting to Order Confirmation email

Posted: Fri Mar 14, 2025 4:47 am
by heatherbell
otgrouch wrote: Thu Mar 13, 2025 5:48 pm Thank you for any input.
Have not yet found an answer but have just tested on latest 1.1.0.0 and confirm this issue persists.

Re: Comments not posting to Order Confirmation email

Posted: Sat Mar 15, 2025 11:36 am
by burt
Probably something to do with the recent changes in this area when the input box was removed from most of the checkout pages. Override the file and use $_SESSION['comments'] ?

Re: Comments not posting to Order Confirmation email

Posted: Sun Mar 16, 2025 6:18 am
by heatherbell
otgrouch wrote: Thu Mar 13, 2025 5:48 pm

Code: Select all

  if (!empty($order->info['comments'])) {
   echo htmlspecialchars($order->info['comments']) . "\n";
After a lot of testing, change that code to:

Code: Select all

echo htmlspecialchars($_POST['comments']) . "\n\n";
Note this removes the "if" condition.
Tested with no comments entered and with comments entered.
In both cases, the e-mail received by the customer works as expected.

Screenshot 2025-03-16 062101.png

Re: Comments not posting to Order Confirmation email

Posted: Sun Mar 30, 2025 3:43 pm
by mohawk
Hi,
My notes are not containing customer comments.
I can see the notes above
if (!empty($order->info['comments'])) {
echo htmlspecialchars($order->info['comments']) . "\n";

and change this to
echo htmlspecialchars($_POST['comments']) . "\n\n";

I am not a coding guy, and the website is working fine. However I will be asking my customers to tell me what size they want in the comments.

Hopefully the above works, but can someone tell me what table this is in please.

Re: Comments not posting to Order Confirmation email

Posted: Sun Mar 30, 2025 3:58 pm
by heatherbell
mohawk wrote: Sun Mar 30, 2025 3:43 pm Hopefully the above works, but can someone tell me what table this is in please.
The change was made in the file - tpl_n_checkout.php
Use your host control panel or use FTP to edit that file which can be found here - /includes/modules/notifications/templates/tpl_n_checkout.php

You will see the lines to be changed - https://github.com/CE-PhoenixCart/Phoen ... hp#L21-L23

Change that code as detailed in my previous post.