Jump to content

technologymatters

Members
  • Content count

    1
  • Joined

  • Last visited

Everything posted by technologymatters

  1. technologymatters

    Batch Print Center (support thread)

    I've got a fix for the missing first label, if anybody needs it. In short, what I did was add a little bit of code to the "print_address" function in /admin/batch_print.php, and set one global variable in /templates/Labels.php, to test which record we were on. And if we were on the first record of the first page, we would reset the cursor in the $orders_query array back to the start. Here are the pieces of code in question - compare them to what you have, and good luck! :) in admin/batch_print.php, ~line 227 function print_address($x, $y){ global $pdf, $num, $billing; $pos = $y; global $orders_query; global $no; global $num; if ($no == 0 && $num == 0) { mysql_data_seek($orders_query, 0); } if ($orders = tep_db_fetch_array($orders_query)){ $order = new order($orders['orders_id']); if ($billing == true) $addressparts = explode("\n", tep_address_format($order->billing['format_id'], $order->billing, 1, '', " \n")); else $addressparts = explode("\n", tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', " \n")); foreach($addressparts as $addresspart){ $fontsize = GENERAL_FONT_SIZE; while ($pdf->getTextWidth($fontsize, $addresspart) > LABEL_WIDTH){ $fontsize--; } //$addresspart = preg_replace("%,[[:space:]]*$%", "", $addresspart); $pdf->addText($x,$pos -=GENERAL_LINE_SPACING,$fontsize,ucwords(strtolower($addresspart))); } $pdf->addText($x + LABEL_WIDTH - ORDERIDXOFFSET,$y + ORDERIDYOFFSET,ORDERIDFONTSIZE,$orders['orders_id']); $no++; } else { return false; } } And in /admin/includes/modules/batch_print/templates/Labels.php, ~line 51 Add this -- $no = 0; -- just before this -- for($y = $pdf->ez['pageHeight'] - STARTY; $y > LABEL_HEIGHT - STARTY; $y -= LABEL_HEIGHT) {
×