Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Batch Form print - with comments on screen

    Hello -

    When say 100 orders come in, 35 may have comments. We then may print 10 of those. Having the comments in Batch Form Print makes this a one process step.

    I've been working at this a while and cannot get the 1st comment to be generated in the extra column I created in Batch Form Print.

    Here is what I have so far and it's generating --none-- , so at least it's half there...

    PHP Code:
    <td class="dataTableContent" align="left">
                    <?php 
                    
    //--Add comments starts--
    $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 limit 1"
    );
    //--Add comments ends--
                    
    echo ($orders_history->fields['comments'] == '' TEXT_NONE nl2br(zen_db_output($orders_history->fields['comments']))) ?></td>
    I am assuming I have the execute code in the wrong location. any help?

  2. #2
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Batch Form print - with comments on screen

    I can see where the php code to grab the info should be higher on the page - below the order search function before the display of the orders... correct? That would split the code in two spots.

    1. php code to grab the info (but exactly where ???
    PHP Code:
    <?php 
    //--Add comments starts--
    $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 limit 1"
    );
    //--Add comments ends-- 
        
    ?>
    2. The display of the comment in the table on screen
    PHP Code:
    <td class="dataTableContent" align="left"> echo ($orders_history->fields['comments'] == '' TEXT_NONE nl2br(zen_db_output($orders_history->fields['comments']))) ?> </td> 
    Is this getting closer?

  3. #3
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Batch Form print - with comments on screen

    this is so close.

    I put the execute code up at the top of the page - under the require code, still nothing. It seems like it makes sense and should work, but......

    any suggestions?

  4. #4
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Batch Form print - with comments on screen

    Able to get this to work by replacing $oID with
    $orders->fields['orders_id'] and putting the code within the order loop.

    I get the comments displayed BUT it takes the comment from the newest order and repeats it for all orders down the column.

    Any suggestions to display the associated order comment?

  5. #5
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Batch Form print - with comments on screen

    any help would be greatly appreciated!

    I have changed the code to display the comment in the form of batch print to this:
    PHP Code:
    <td class="dataTableContent" align="left"><?php echo $orders_history->fields['comments']; ?></td>
    Still repeats the newest orders' first comment for all orders down the column.

    Anyone know how to stop this and have that order from that line be associated to it's own 1st comment (if a comment was inputted on that order during checkout)

    Coffee anyone?

  6. #6
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Batch Form print - with comments on screen

    I would like to add the resolution to this. This adds the first comment from the order being placed to the table on super_batch_forms.php
    Makes for easy comment reading batch style for us.

    Not the only thread I tend to speak with myself on... really I get out of the office sometimes and see daylight.

    Code to add at about 293 in the table
    PHP Code:
    <td class="dataTableHeadingContent" align="left" colspan="2">Order Comments</td
    Code to add about line 297 before the end of the loop after while (!$orders->EOF) {
    PHP Code:
    //--Add comments starts--
    $orders_history $db->Execute("select comments
    from " 
    TABLE_ORDERS_STATUS_HISTORY "
    where orders_id = '" 
    zen_db_input($orders->fields['orders_id']) . "'
    order by date_added limit 1"
    );
    //--Add comments ends-- 
    add Line of code what is now about 314 in the table
    PHP Code:
    <td class="dataTableContent" align="left" width="400"><?php echo $orders_history->fields['comments']; ?></td>

 

 

Similar Threads

  1. Batch Form Print PHP FATAL ERROR
    By abcgiftcards in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 5 May 2010, 03:12 PM
  2. Super Orders Batch Form Print & Update Slow
    By totalsam in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 24 Oct 2009, 01:54 PM
  3. Super Orders - Add DETAILS to Batch Form Print
    By spectreman in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 14 Nov 2006, 10:07 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR