Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Posts
    32
    Plugin Contributions
    0

    Default Show ONLY customer comments on Invoice and Packing Slip

    How can I customize admin\packingslip.php and invoice.php to show only the customer comments in the comments section? When you turn these on in the admin:

    Display Order Comments on Admin Invoice
    Display Order Comments on Admin Packing

    It places a table across the bottom of those documents with dates, check marks, and all the status updates of the orders, even if the Display Order Comments is set to "1".

    All I want is for the customer comment from the order to appear on the admin invoice and admin packing. In our shop, we print the admin invoice and pull the products, so it helps to have any order comments right there on the sheet. The other stuff is not necessary.

    Here is the relevant code

    Code:
    <?php if (ORDER_COMMENTS_PACKING_SLIP > 0) { ?>
          <tr>
            <td class="main"><table border="1" cellspacing="0" cellpadding="5">
              <tr>
                <td class="smallText" align="center"><strong><?php echo TABLE_HEADING_DATE_ADDED; ?></strong></td>
                <td class="smallText" align="center"><strong><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></strong></td>
                <td class="smallText" align="center"><strong><?php echo TABLE_HEADING_STATUS; ?></strong></td>
                <td class="smallText" align="center"><strong><?php echo TABLE_HEADING_COMMENTS; ?></strong></td>
              </tr>
    <?php
        $orders_history = $db->Execute("select orders_status_id, date_added, customer_notified, comments
                                        from " . TABLE_ORDERS_STATUS_HISTORY . "
                                        where orders_id = '" . zen_db_input($oID) . "'
                                        order by date_added");
    
        if ($orders_history->RecordCount() > 0) {
          $count_comments=0;
          while (!$orders_history->EOF) {
            $count_comments++;
            echo '          <tr>' . "\n" .
                 '            <td class="smallText" align="center">' . zen_datetime_short($orders_history->fields['date_added']) . '</td>' . "\n" .
                 '            <td class="smallText" align="center">';
            if ($orders_history->fields['customer_notified'] == '1') {
              echo zen_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
            } else {
              echo zen_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
            }
            echo '            <td class="smallText">' . $orders_status_array[$orders_history->fields['orders_status_id']] . '</td>' . "\n";
            echo '            <td class="smallText">' . ($orders_history->fields['comments'] == '' ? TEXT_NONE : nl2br(zen_db_output($orders_history->fields['comments']))) . '&nbsp;</td>' . "\n" .
                 '          </tr>' . "\n";
            $orders_history->MoveNext();
            if (ORDER_COMMENTS_PACKING_SLIP == 1 && $count_comments >= 1) {
              break;
            }
          }
        } else {
            echo '          <tr>' . "\n" .
                 '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
                 '          </tr>' . "\n";
        }
    ?>
            </table></td>
          </tr>
    <?php } // order comments ?>
    
    </table>

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Show ONLY customer comments on Invoice and Packing Slip

    You need to comment out or remove what you don't want to see ... something like this should work on the packingslip.php file:
    Code:
    <?php if (ORDER_COMMENTS_PACKING_SLIP > 0) { ?>
          <tr>
            <td class="main"><table border="0" cellspacing="0" cellpadding="5">
              <tr>
                <td class="smallText" align="center"><strong><?php //echo TABLE_HEADING_DATE_ADDED; ?></strong></td>
                <td class="smallText" align="center"><strong><?php //echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></strong></td>
                <td class="smallText" align="center"><strong><?php //echo TABLE_HEADING_STATUS; ?></strong></td>
                <td class="smallText" align="center"><strong><?php //echo TABLE_HEADING_COMMENTS; ?></strong></td>
              </tr>
    <?php
        $orders_history = $db->Execute("select orders_status_id, date_added, customer_notified, comments
                                        from " . TABLE_ORDERS_STATUS_HISTORY . "
                                        where orders_id = '" . zen_db_input($oID) . "'
                                        order by date_added");
    
        if ($orders_history->RecordCount() > 0) {
          $count_comments=0;
          while (!$orders_history->EOF) {
            $count_comments++;
            //echo '          <tr>' . "\n" .
                 '            <td class="smallText" align="center">' . zen_datetime_short($orders_history->fields['date_added']) . '</td>' . "\n" .
                 '            <td class="smallText" align="center">';
            if ($orders_history->fields['customer_notified'] == '1') {
              //echo zen_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
            } else {
              //echo zen_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
            }
            //echo '            <td class="smallText">' . $orders_status_array[$orders_history->fields['orders_status_id']] . '</td>' . "\n";
            echo '            <td class="smallText">' . ($orders_history->fields['comments'] == '' ? TEXT_NONE : nl2br(zen_db_output($orders_history->fields['comments']))) . '&nbsp;</td>' . "\n" .
                 '          </tr>' . "\n";
            $orders_history->MoveNext();
            if (ORDER_COMMENTS_PACKING_SLIP == 1 && $count_comments >= 1) {
              break;
            }
          }
        } else {
            //echo '          <tr>' . "\n" .
                 '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
                 '          </tr>' . "\n";
        }
    ?>
            </table></td>
          </tr>
    <?php } // order comments ?>
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Nov 2008
    Posts
    32
    Plugin Contributions
    0

    Default Re: Show ONLY customer comments on Invoice and Packing Slip

    Thanks, Ajeh :)

    That worked great for me, I used the same concept on my invoice page as well.

    I honestly wasn't sure what to comment out, the things I tried would break the php code. Now I see that if you comment out the "echo" parts it doesn't display those bits on the page. It makes sense and I think I have learned something today!

  4. #4
    Join Date
    Jul 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: Show ONLY customer comments on Invoice and Packing Slip

    Thanks. I tried that and it works great. For Paypal and credit card customers, it only show something like this
    "Credit Card payment. AUTH: xxxxxx. TransID: xxxxxxxxxx." and did not show customer's comment.

    If I set these to "2"
    Display Order Comments on Admin Invoice
    Display Order Comments on Admin Packing
    It will show everything.
    How can I set it to show only customer's comments? Thanks.

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Show ONLY customer comments on Invoice and Packing Slip

    Did you try using the one just for the Customer Comments:
    Display Order Comments on Admin Invoice
    Do you want to display the Order Comments on the Admin Invoice?
    0= OFF
    1= First Comment by Customer only
    2= All Comments for the Order
    Display Order Comments on Admin Packing Slip
    Do you want to display the Order Comments on the Admin Packing Slip?
    0= OFF
    1= First Comment by Customer only
    2= All Comments for the Order
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Jul 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: Show ONLY customer comments on Invoice and Packing Slip

    yes I did. If I set to "1" it will show only credit card or paypal payment info.
    btw, I'm using version 1.3.8a and installed some modules like: Admin profile, edit orders, min order amount, sms onsale, supertracker, and time zone offset. Not sure if they affected the files.
    Last edited by peco1; 25 Oct 2009 at 01:07 AM.

 

 

Similar Threads

  1. Making Customer ID visible in Invoice and Packing Slip
    By kohul1 in forum Managing Customers and Orders
    Replies: 4
    Last Post: 28 Nov 2011, 12:59 PM
  2. Customer details not appearing on Packing slip and Invoice
    By richardsnowstar in forum General Questions
    Replies: 0
    Last Post: 4 Nov 2010, 11:25 PM
  3. Show shipping weight on invoice or packing slip?
    By raspberryjamcloth in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 21 Dec 2008, 10:24 PM
  4. Customer comments can be included on packing slip and invoice
    By rayw1679 in forum Basic Configuration
    Replies: 1
    Last Post: 22 Apr 2008, 07:01 PM

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