Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Posts
    16
    Plugin Contributions
    0

    Default PDOFC Order Centre - howto print only 1st comment?

    I've been modifying built in templates to suit my needs and I'm looking for a way to create a template that would add only the 1st comment to the invoice. Any ideas how to do it?

    Otherwise I can only recommend using PDOFC - awesome mod. I can only wish the templates would be easier to customize

  2. #2
    Join Date
    Jul 2008
    Posts
    16
    Plugin Contributions
    0

    Default Re: PDOFC Order Centre - howto print only 1st comment?

    Ok , SO I fured out I need to make changes somewhere here:

    Code:
    if ($show_comments) {  // print out all comments for this order
      
        $innum = $orders->fields['orders_id'];
        $orders_comments = $db->Execute("select comments,date_added from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$innum . "' order by date_added");
    
        if ($orders_comments->RecordCount()>0) {
      
    	  // resume printing comments where we left off,
    	  // if page was split 	
    	  for ($i=0; $i<$nextcomment; $i++)
    	  {
    		  $orders_comments->MoveNext();
    	  }
          while (!$orders_comments->EOF) {
        
            if(zen_not_null($orders_comments->fields['comments'])) {
          
    			// check whether too far down page to print more comments
    		    //
    		    if ($pos < PDFOC_BOTTOM_MARGIN) {
    		       $secondpage = true;
    		       return;
    		    }
              $pdf->ezSetY($pos);
              $cy = $pdf->ezText(zen_date_short($orders_comments->fields['date_added']) ,7); // 7 is font size here
              $pdf->ezText("<b>". PDFOC_TEXT_COMMENTS . "</b>",PDFOC_COMMENTS_FONT_SIZE);
              $cx = $pdf->getTextWidth(PDFOC_COMMENTS_FONT_SIZE,PDFOC_TEXT_COMMENTS) + PDFOC_LEFT_MARGIN;
              $pdf->ezSetY($cy);
              $y = $pdf->ezText(pdfoc_html_cleanup($orders_comments->fields['comments']),PDFOC_COMMENTS_FONT_SIZE, array('aleft'=>$cx+10));
              $pos = ($y -5);
            
            }  // EOIF zen_not_null
          
            $orders_comments->MoveNext();
            $nextcomment++;
          } // EOWHILE $orders_comments
        
        } // EOIF $orders_comments->RecordCount()
    
      } // EOIF $show_comments
    But to be honest I don't understand how it works. Any help would be greatly appreciated.

 

 

Similar Threads

  1. Easy Populate Upload - Only adding 1st product
    By milehighautomation in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 11 Nov 2008, 06:10 AM
  2. SSL admin is only HTTPS on 1st page
    By surlyjake in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 1 Oct 2006, 03:11 AM
  3. Orders- Update status of order, delete order or print order paperwork.
    By dandownunder in forum Managing Customers and Orders
    Replies: 6
    Last Post: 8 Aug 2006, 09:11 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