
Originally Posted by
fo0bar
my apologies to everyone about not sharing the code here

i felt that since i'd mucked around so much, i'd lost track of exactly *where* i'd fiddled, and couldn't really give a "replace here to here" kind of submission

I can help with that :) I compared the file you gave me with the file that came with SO3. These are the resulting changes:
1. Add tick/check box in front of each order item
2. Add spaces between each order item line
3. Decrease order item font size in order to make room for the addition of customer address
4. Moved Product ID Number and Order Date to align right
5. Added customer address (aligned right)
These changes make the master packing slip pdf (found in batch printing) much easier to read and much more functional! Thanks Fo0bar!
Here's the code:
EDIT 1
At or about Line 219, Find:
PHP Code:
$pdf->Cell(10, 10, '', 'LRTB');
On the next line, Replace This:
PHP Code:
$pdf->MultiCell(566, 12, $headingLine);
With This:
PHP Code:
$pdf->SetFontSize('10');
$pdf->Cell(450, 12, $headingLine,'','0');
$orderRightBox = '#' . $order->info[id] . ' ' . zen_date_short($order->info['date_purchased']) . ' ';
$pdf->MultiCell('180','10',$orderRightBox,'','','R');
$pdf->SetFontSize('6');
$shipTo = zen_address_format($order->delivery['format_id'], $order->delivery, 0, '', "\n");
if($order->delivery['street_address'] == ''){
$shipTo = zen_address_format($order->customer['format_id'], $order->customer, 0, '', "\n");
}
$pdf->Cell('580','10',$shipTo,'','','R');
$pdf->MultiCell(566,2,'');
EDIT 2
At or about Line 226, Find:
PHP Code:
if ($orderText != ''){
On the next line, Replace This:
PHP Code:
$orderText .= ', ';
With This:
PHP Code:
$orderText = '';
//$orderText .= ', ';
EDIT 3
At or about Line 227, Find:
On the next line, Replace This:
PHP Code:
$orderText .= '(' . $order->products[$i]['qty'] . ') ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'];
With This:
PHP Code:
//This modification displays the attribute title in the line.
$attribText = (!$order->products[$i]['attributes'][0]['value']) ? '' : (' - ' . $order->products[$i]['attributes'][0]['value']) ;
$orderText .= ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'] . $attribText;
$pdf->Cell(27, 10, '');
$pdf->Cell(8, 8, '', 'LRTB');
$pdf->Cell(5, 0, '');
$pdf->SetFontSize('6');
$pdf->MultiCell(520, 10, $orderText); //display order text
EDIT 4
At or about Line 230, Find:
PHP Code:
/* order object doesn't include orderid. added id to info so we can retrieve it here */
On the next line, Replace This:
PHP Code:
$orderText = '[#' . $order->info[id] . ' ' . zen_date_short($order->info['date_purchased']) . '] ' . $orderText;
$pdf->Cell(27, 12, '');
$pdf->MultiCell(549, 12, $orderText);
With This:
PHP Code:
$pdf->MultiCell(520,8,'');
Bookmarks