You can see the customer's comments when you view the details of the order.
P.S. I didn't say it was "expected behavior", just that the behavior hasn't changed since v1.5.4.
You can see the customer's comments when you view the details of the order.
P.S. I didn't say it was "expected behavior", just that the behavior hasn't changed since v1.5.4.
Last edited by lat9; 30 Jun 2016 at 01:09 PM. Reason: Added P.S.
I know you can, but I thought it might be beneficial to have the comment printed in the side box also, so that its available at a glance before opening each order.
I'm currently trying to figure out how to safely extract the actual comment around line 993 of the orders.php:
I've got the comment to display by using the below, but do I need to sanitize the output in some way?Code:// indicate if comments exist $orders_history_query = $db->Execute("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . $oInfo->orders_id . "' and comments !='" . "'" ); if ($orders_history_query->RecordCount() > 0) { $contents[] = array('align' => 'left', 'text' => '<br />' . TABLE_HEADING_COMMENTS); }
Code:// indicate if comments exist $orders_history_query = $db->Execute("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . $oInfo->orders_id . "' and comments !='" . "'" ); if ($orders_history_query->RecordCount() > 0) { $contents[] = array('align' => 'left', 'text' => '<br />' . TABLE_HEADING_COMMENTS) . ":"; $contents[] = array('align' => 'left', 'text' => $orders_history_query->fields['comments']); }
Last edited by bottyz; 30 Jun 2016 at 01:36 PM. Reason: cleaning the code layout
At first glance that looks like it'll probably work.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Has there been any follow up on this? I've been trying to find a fix, and while the above code works, I only want it to display the Customer's comment, not the transaction report from the credit card processing. More the same as the packing slip only shows the first comment and only if the customer left a comment, otherwise it says "--none--"Code:// indicate if comments exist $orders_history_query = $db->Execute("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . $oInfo->orders_id . "' and comments !='" . "'" ); if ($orders_history_query->RecordCount() > 0) { $contents[] = array('align' => 'left', 'text' => '<br />' . TABLE_HEADING_COMMENTS) . ":"; $contents[] = array('align' => 'left', 'text' => $orders_history_query->fields['comments']); }
There is a small error in your code. At the end of the previous line, where you added a colon to be displayed after TABLE_HEADING_COMMENTS, that colon should be inside of the right parenthesis. Other than that, it works great! :-)
Here is a corrected version of the code...
When things like this are found in the code, is there an official way to notify the development team so that it can be fixed for future releases of Zen Cart?Code:// indicate if comments exist $orders_history_query = $db->Execute("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . $oInfo->orders_id . "' and comments !='" . "'" ); if ($orders_history_query->RecordCount() > 0) { $contents[] = array('align' => 'left', 'text' => '<br />' . TABLE_HEADING_COMMENTS . ":"); $contents[] = array('align' => 'left', 'text' => $orders_history_query->fields['comments']); }
Doug
For confirmed bugs in the software, you can post the problem and solution in the Bug Reports section of the forum. If there's a discussion already in another area, post a link to that other discussion for reference, but ideally include the complete solution in the Bug Report. It should also clearly explain which version/s are affected by the bug.
If you're contributing code fixes, and are comfortable with software development tools like "git", then submitting the code on Github is recommended. The process is documented here: http://docs.zen-cart.com/Contributing/main with links to detailed steps on how to use git and github.
Anything submitted on github will have a code-review by the dev team, and if approved will be merged into the next release.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
That's exactly what I was looking for... thank you very much!
-Doug
Has there been any upgrades to this so that only customer comments are listed and not the transaction details if they did not leave a comment? Only using the first comment from the customer and blank otherwise? I thought we had worked this out, but I migrated to a new server and used a clean install. I can't seem to find anything for this. Thank you.