Results 1 to 10 of 13

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: Customers Comments Don't Show In Admin orders.php

    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.

  2. #2
    Join Date
    Mar 2010
    Location
    Nottingham UK
    Posts
    87
    Plugin Contributions
    1

    Default Re: Customers Comments Don't Show In Admin orders.php

    Quote Originally Posted by lat9 View Post
    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.
    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:

    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);
            }
    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) . ":";
                $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

  3. #3
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Customers Comments Don't Show In Admin orders.php

    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.

  4. #4
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    110
    Plugin Contributions
    2

    Default Re: Customers Comments Don't Show In Admin orders.php

    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']);
    
            }
    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--"

  5. #5
    Join Date
    Jan 2017
    Location
    USA
    Posts
    6
    Plugin Contributions
    0

    Default Re: Customers Comments Don't Show In Admin orders.php

    Quote Originally Posted by bottyz View Post

    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) . ":";
                $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...

    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']);
            }
    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?


    Doug

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Customers Comments Don't Show In Admin orders.php

    Quote Originally Posted by turbodoug View Post
    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?

    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.

  7. #7
    Join Date
    Jan 2017
    Location
    USA
    Posts
    6
    Plugin Contributions
    0

    Default Re: Customers Comments Don't Show In Admin orders.php

    That's exactly what I was looking for... thank you very much!


    -Doug

  8. #8
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    110
    Plugin Contributions
    2

    Default Re: Customers Comments Don't Show In Admin orders.php

    Quote Originally Posted by jwlamb View Post
    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--"
    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.

 

 

Similar Threads

  1. Addin Repeat Customers in Admin -> Customers -> Orders.php
    By fabburl in forum Managing Customers and Orders
    Replies: 3
    Last Post: 25 Feb 2014, 05:05 AM
  2. Google checkout orders don't show up in admin panel.
    By mohinder in forum Addon Payment Modules
    Replies: 10
    Last Post: 21 Nov 2007, 09:35 AM
  3. Paypal IPN ALL orders don't show up in Admin
    By theng6987 in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 23 Sep 2007, 04:26 PM
  4. New users and orders don't show up in Admin
    By jaztechnologies in forum General Questions
    Replies: 1
    Last Post: 6 Jul 2007, 02:02 AM
  5. Revisting Customers - Need to Show in orders.php
    By phil_lazenby in forum Managing Customers and Orders
    Replies: 0
    Last Post: 21 Jun 2006, 11:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg