Jump to content
Sign in to follow this  
blurb

Batch Print Center (support thread)

Recommended Posts

I replaced the file and this is waht I get now:

 

0, 'text' => 'None'); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_statuses[] = array('id' => $orders_status['orders_status_id'],'text' => $orders_status['orders_status_name']); } ?> $file,'text' => $filename); } } ?>

 

Also the template pull-down is empty.

 

Thanks, again.

Share this post


Link to post
Share on other sites
Ops, one more thing. Actually, it is not the lowest order that gets skipped... but the first one on each page. If you print let's say 4 pages of labels, you will be missing 4 labels, since the one that should go on the first place on each page will be skipped

(if you have 10 labels on each page, 44 labels for oders 1-44 would actually take 4 pages to print; labels for orders 1-12-23-34 will be missing)

 

Guess I give up on this one for now. I have my templates up and running and the first order number on my shipping labels and shipping relations is missing. So I have to always add an extra (lower number) invoice when printing, and I have to do one page at a time if I have more than I can fit on a single page. Oh well, I guess I can live with it, but I am not able to see where the error comes from, and I do not even understand some of the code on BVPC and the template system. Oh well... :(


MindTwist of Twisted Reality and Twisted Tienda

Share this post


Link to post
Share on other sites

Hello.

 

This is my first message as you can see.

 

I've installed this contribution which works really fine for me, thanks to the creator. No problem if the first label is not included in each page.

 

I've been looking in this thread information regarding the font size used in the Labels template.

 

I'm able to change everythig except the font size of the name and address of the customer. I guess the code for this is located at "labels.php" inside "templates" folder:

 

define('GENERAL_FONT_SIZE', '40');

define('GENERAL_LINE_SPACING', '15');

define('GENERAL_FONT_COLOR', BLACK);

 

When I change the value of the second line, the spacing changes, but when I change the value of the first line nothing happens.

 

I don't now anything of php coding... so I don't know where else I can look for this issue.

 

Regards. Manolo.

Share this post


Link to post
Share on other sites
Hello.

 

This is my first message as you can see.

 

I've installed this contribution which works really fine for me, thanks to the creator. No problem if the first label is not included in each page.

 

I've been looking in this thread information regarding the font size used in the Labels template.

 

I'm able to change everythig except the font size of the name and address of the customer. I guess the code for this is located at "labels.php" inside "templates" folder:

 

define('GENERAL_FONT_SIZE', '40');

define('GENERAL_LINE_SPACING', '15');

define('GENERAL_FONT_COLOR', BLACK);

 

When I change the value of the second line, the spacing changes, but when I change the value of the first line nothing happens.

 

I don't now anything of php coding... so I don't know where else I can look for this issue.

 

Regards. Manolo.


--

Chris Thomas

Share this post


Link to post
Share on other sites

Sorry I just seemed to copy the last person's post!

 

I do have the same problem though. I'm using the labels.php template. When I change define('GENERAL_FONT_SIZE', '14');

to any other number the font size does not change. However, if I change define('ORDERIDFONTSIZE', '6'); to any other number this does work OK.

 

I don't understand why one works and the other doesn't. I'm not a coder but I was wondering if the value of GENERAL_FONT_SIZE needs to be declared somewhere later in the file, maybe somewhere in this code:

 

for($y = $pdf->ez['pageHeight'] - STARTY; $y > LABEL_HEIGHT - STARTY; $y -= LABEL_HEIGHT) {

 

 

for ($x = STARTX; $x < STARTX + NUM_COLUMNS * LABEL_WIDTH; $x += LABEL_WIDTH){

if ($startpos <= $pos && $num < $endpos){

 

if (print_address($x, $y))

$num++;

}

$pos++;

}

 

 

If anyone can help I'd be really grateful. This is a fab contribution.

 

Chris


--

Chris Thomas

Share this post


Link to post
Share on other sites

Sorry I just seemed to copy the last person's post!

 

I do have the same problem though. I'm using the labels.php template. When I change define('GENERAL_FONT_SIZE', '14');

to any other number the font size does not change. However, if I change define('ORDERIDFONTSIZE', '6'); to any other number this does work OK.

 

I don't understand why one works and the other doesn't. I'm not a coder but I was wondering if the value of GENERAL_FONT_SIZE needs to be declared somewhere later in the file, maybe somewhere in this code:

 

for($y = $pdf->ez['pageHeight'] - STARTY; $y > LABEL_HEIGHT - STARTY; $y -= LABEL_HEIGHT) {

 

 

for ($x = STARTX; $x < STARTX + NUM_COLUMNS * LABEL_WIDTH; $x += LABEL_WIDTH){

if ($startpos <= $pos && $num < $endpos){

 

if (print_address($x, $y))

$num++;

}

$pos++;

}

 

 

If anyone can help I'd be really grateful. This is a fab contribution.

 

Chris


--

Chris Thomas

Share this post


Link to post
Share on other sites
I replaced the file and this is waht I get now:

 

0, 'text' => 'None'); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_statuses[] = array('id' => $orders_status['orders_status_id'],'text' => $orders_status['orders_status_name']); } ?> $file,'text' => $filename); } } ?>

 

Also the template pull-down is empty.

 

Thanks, again.

 

I just installed and get the same error. Did you ever find a solution?

Share this post


Link to post
Share on other sites
define('GENERAL_FONT_SIZE', '40');

define('GENERAL_LINE_SPACING', '15');

define('GENERAL_FONT_COLOR', BLACK);

 

When I change the value of the second line, the spacing changes, but when I change the value of the first line nothing happens.

 

I have found a fix for this now. If you open:

 

/httpdocs/poi/admin/includes/languages/english/batch_print.php

 

there is another define for GENERAL_FONT_SIZE. Changing this one here does affect the Labels.php (however, it also affects any other templates using GENERAL_FONT_SIZE).

 

Kind regards, Chris


--

Chris Thomas

Share this post


Link to post
Share on other sites
Guess I give up on this one for now. I have my templates up and running and the first order number on my shipping labels and shipping relations is missing. So I have to always add an extra (lower number) invoice when printing, and I have to do one page at a time if I have more than I can fit on a single page. Oh well, I guess I can live with it, but I am not able to see where the error comes from, and I do not even understand some of the code on BVPC and the template system. Oh well... :(

 

I've had this same problem forever... It is a great contribution, but that label thing is a real bummer... Anybody find a fix for this yet?

:-"

Share this post


Link to post
Share on other sites
I've had this same problem forever... It is a great contribution, but that label thing is a real bummer... Anybody find a fix for this yet?

:-"

 

 

Mayne Im missing something bu when I select the date to show all orders nothings showing up. I get "There were no orders selected for export, try changing your order options."

 

I went and bought something from the store and tried again and got the same thing. I select my options and hit send and nothing.


DnVWeb design - eCommerce, Templates, Installation, Unbeatable Prices

Share this post


Link to post
Share on other sites
I've had this same problem forever... It is a great contribution, but that label thing is a real bummer... Anybody find a fix for this yet?

:-"

 

hey there, i've posted a fix for this missing print label bug.. you can check out the fix at my blog, i've uploaded the files there.

i basically just modified the print_address function at the bottom of the batch_print.php..

 

have fun! :thumbsup:


Why, then the world’s mine oyster,

Which I with sword will open.

 

William Shakespeare

"The Merry Wives of Windsor, Act II, Scene II, 2-5."

Share this post


Link to post
Share on other sites

I find this contribution among the most useful on oscommerce. I do wonder, however, if there is a way to organize the products when they print, to ensure that eh attributes always print in either alphabetical or reverse alpha, or some way. My guess is that, in the case of the invoice or packing list, changing the following text some way is needed:

 

 

if ( ($k = sizeof($order->products[$i]['attributes'])) > 0) {

for ($j = 0; $j < $k; $j++) {

$attrib_string = '<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];

if ($order->products[$i]['attributes'][$j]['price'] != '0') {

$attrib_string .= ' (' . $order->products[$i]['attributes'][$j]['prefix'] .

$currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';

 

}

 

$attrib_string .= '</i>';

Share this post


Link to post
Share on other sites

@josemanuel

 

yes, there is a way to sort the attributes in alphabetical or reverse order..

this is a little array manipulation, just insert this code between the if and for..

 

	if ( ($k = sizeof($order->products[$i]['attributes'])) > 0) {

// begin insert
// Obtain a list of columns
// option
// value
// price
// prefix
$sort_options = array();
$sort_values = array();
$sort_prices = array();
$sort_prefixes = array();
foreach ($order->products[$i]['attributes'] as $key => $row) {
$sort_options[$key]  = $row['option'];
$sort_values[$key] = $row['value'];
$sort_prices[$key] = $row['price'];
$sort_prefixes[$key] = $row['prefix'];
}
// Sort the data with descending, ascending, etc.
// Add $data as the last parameter, to sort by the common key
array_multisort(
$sort_options, SORT_DESC,
$sort_values, SORT_ASC, 
$sort_prices, SORT_ASC, 
$sort_prefixes, SORT_ASC, 
$order->products[$i]['attributes']);
// end insert

	for ($j = 0; $j < $k; $j++) {
	$attrib_string = '<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
	if ($order->products[$i]['attributes'][$j]['price'] != '0') { 
	$attrib_string .= ' (' . $order->products[$i]['attributes'][$j]['prefix'] . 
	$currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; 

	}

	$attrib_string .= '</i>';

 

you can change the SORT_ASC or SORT_DESC to suit your needs..

:thumbsup:


Why, then the world’s mine oyster,

Which I with sword will open.

 

William Shakespeare

"The Merry Wives of Windsor, Act II, Scene II, 2-5."

Share this post


Link to post
Share on other sites

I've got a couple of extra fields to do with invoice numbers in my Orders table - INVOICE_SERIAL and INVOICE_NUMBER

 

I've added this line to my template

 

$y= $pdf->ezText("<b>" . TEXT_INVOICE . " </b>" . $orders['invoice_serial'] . $orders['invoice_number'] ."\n",SUB_HEADING_FONT_SIZE;

 

But all that appears on the PDF is the text INVOICE: (which is what TEXT_INVOICE is set to). The Serial prefix and Invoice number don't appear.

 

I guess that I'm missing something from a query in another file, but I'm not sure which module the batch print template gets it's data from. Any ideas would be greatly appreciated!

Edited by andrew71

Share this post


Link to post
Share on other sites

Hello andrew71,

 

I've got a couple of extra fields to do with invoice numbers in my Orders table - INVOICE_SERIAL and INVOICE_NUMBER

 

I've added this line to my template

 

$y= $pdf->ezText("<b>" . TEXT_INVOICE . " </b>" . $orders['invoice_serial'] . $orders['invoice_number'] ."\n",SUB_HEADING_FONT_SIZE;

 

But all that appears on the PDF is the text INVOICE: (which is what TEXT_INVOICE is set to). The Serial prefix and Invoice number don't appear.

 

I guess that I'm missing something from a query in another file, but I'm not sure which module the batch print template gets it's data from. Any ideas would be greatly appreciated!

 

The batch print gets its orders data direct from the database. You can add those extra fields in the sql query in this line,

$orders_query = tep_db_query("select 

o.invoice_serial, o.invoice_number,

o.orders_id,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where h.orders_id = o.orders_id" . $pull_w_status . $get_customer_comments . ' group by o.orders_id');

This is line 79 in my batch_print.php under admin/.

 

Cheers! :)

Edited by oyster.collector

Why, then the world’s mine oyster,

Which I with sword will open.

 

William Shakespeare

"The Merry Wives of Windsor, Act II, Scene II, 2-5."

Share this post


Link to post
Share on other sites
Hello andrew71,

The batch print gets its orders data direct from the database. You can add those extra fields in the sql query in this line,

$orders_query = tep_db_query("select 

o.invoice_serial, o.invoice_number,

o.orders_id,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where h.orders_id = o.orders_id" . $pull_w_status . $get_customer_comments . ' group by o.orders_id');

This is line 79 in my batch_print.php under admin/.

 

Cheers! :)

 

Thanks oyster.collector - that was exactly what I needed. It didn't work for a while until I realised that there was a missing closing bracket on the line that I'd added to my template too.

 

This line

 

$y= $pdf->ezText("<b>" . TEXT_INVOICE . " </b>" . $orders['invoice_serial'] . $orders['invoice_number'] ."\n",SUB_HEADING_FONT_SIZE;

 

Should have been this instead

 

$y= $pdf->ezText("<b>" . TEXT_INVOICE . " </b>" . $orders['invoice_serial'] . $orders['invoice_number'] ."\n",SUB_HEADING_FONT_SIZE);

 

 

Thanks for your help

Edited by andrew71

Share this post


Link to post
Share on other sites
@josemanuel

 

yes, there is a way to sort the attributes in alphabetical or reverse order..

this is a little array manipulation, just insert this code between the if and for..

 

	if ( ($k = sizeof($order->products[$i]['attributes'])) > 0) {

// begin insert
// Obtain a list of columns
// option
// value
// price
// prefix
$sort_options = array();
$sort_values = array();
$sort_prices = array();
$sort_prefixes = array();
foreach ($order->products[$i]['attributes'] as $key => $row) {
$sort_options[$key]  = $row['option'];
$sort_values[$key] = $row['value'];
$sort_prices[$key] = $row['price'];
$sort_prefixes[$key] = $row['prefix'];
}
// Sort the data with descending, ascending, etc.
// Add $data as the last parameter, to sort by the common key
array_multisort(
$sort_options, SORT_DESC,
$sort_values, SORT_ASC, 
$sort_prices, SORT_ASC, 
$sort_prefixes, SORT_ASC, 
$order->products[$i]['attributes']);
// end insert

	for ($j = 0; $j < $k; $j++) {
	$attrib_string = '<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
	if ($order->products[$i]['attributes'][$j]['price'] != '0') { 
	$attrib_string .= ' (' . $order->products[$i]['attributes'][$j]['prefix'] . 
	$currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; 

	}

	$attrib_string .= '</i>';

 

you can change the SORT_ASC or SORT_DESC to suit your needs..

:thumbsup:

 

This looks promising, but I've not been able to quite figure out how the order products list is brought in, and thus what this code is working against...

 

Basically, I am trying to sort the listing based on the 'products_model' field on the order, but I can't figure out how to do it with this - can you point me in the right direction?

 

Thanks!

 

Kris

Share this post


Link to post
Share on other sites

@andrew

 

You're welcome.. :)

 

@jstark

 

The code is for sorting under packing or invoice printing list. It sorts the products in an order via its attributes.

 

I do not quite understand what you mean by products_model field. Is this a custom field under your products for an order?


Why, then the world’s mine oyster,

Which I with sword will open.

 

William Shakespeare

"The Merry Wives of Windsor, Act II, Scene II, 2-5."

Share this post


Link to post
Share on other sites
The code is for sorting under packing or invoice printing list. It sorts the products in an order via its attributes.

 

I do not quite understand what you mean by products_model field. Is this a custom field under your products for an order?

 

Hmm... Maybe that is why I was confused... :)

 

In actuality, we dont' have attributes specifically for products, but what we are trying to do is get the packing list sorted by the Products Model: description, which is stored as a text field in the 'products' table - I believe that it is a part of a even a fairly stock osC install, but am not certain anymore... Each of the various different variants that I've run with in recent memory have included that column in the db as 'products_model' in the 'products' table. It is also then copied into the 'orders_products' table in the 'products_model' column for each ordered item.

 

We have our model field categorized such that the beginning of the field includes information as to where to find the product in the warehouse, so getting the invoice / packing list sorted alphabetically by that field would be great. Initially I was thinking that it would have been something as simple as: SELECT * FROM `orders_products` WHERE `orders_id` = <ordernumber> ORDER BY 'products_model'; However, since there are no similar queries that I can find, I don't know where to go looking...

 

TNX

 

Kris

Share this post


Link to post
Share on other sites
how can I add polish characters to label printing? I need such letters: żźćąśęółń

 

If you look further back in the thread, there was a comment about making sure that the fonts for specific encodings were present. If I recall, the discussion was relating to Chinese, or some other language, but the concept still remains; make sure that the fonts that are used are available in the folder as mentioned in that post...

 

K

Share this post


Link to post
Share on other sites

I installed the Batch Print Center on osc ms2 rc2.

And in admin when I click on the Batch print center link - nothing shows, but Blank page?

Please help me fix this?

Share this post


Link to post
Share on other sites

I am sorry for my rude delay in thanking Oyster Collector for your great enhancement in explaining sorting. I am using this sorting in all of my templates, because we always have a minimum of 5 attributes on every product and this really helps.

Share this post


Link to post
Share on other sites

Hey guys, I'm having a strange one...

 

I've reinstalled the entire contributions using the zip file from Oyster.Collector's blog...

 

http://oyster.x10hosting.com/wp/batch-prin...abel-print-fix/

 

And now when I print labels, I get the first page on the PDF just fine, but every page after page one is totally blank. Any ideas?

 

Thanks in advance,

 

James

;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×