Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Batch Print Center (support thread)


blurb

Recommended Posts

Use the function "print_r($arrayname)" on the variable that is printing out "Array".  That will tell you what is in the array and then you can reference the contents if what you want is in there.

Thanks Jonathan.

 

When I use "print_r($bin)" with three test products I get "Array ( [products_bin_number] => BIN1 ) Array ( [products_bin_number] => BIN6 ) Array ( [products_bin_number] => BIN1234 )".

 

The BIN1, BIN6, and BIN1234 is what I want displayed on the packing slip, but "Array" is displayed instead.

 

Here is the code I am using in the packing slip template:

// GET BIN NUMBER FROM DATABASE
$order_model = $order->products[$i]['model'];
$bin_query[i] = tep_db_query("SELECT products_bin_number FROM " . TABLE_PRODUCTS . " WHERE products_model = '$order_model'");
$bin_number[i] = tep_db_fetch_array($bin_query[i]);
print_r($bin_number[i]); // print contents of the array to the screen.

// BEGIN WRITING ORDER TABLE CONTENTS
$pdf->addText($x,$pos,TABLE_HEADER_FONT_SIZE, $bin_number[i]);

Any suggestions?

Link to comment
Share on other sites

  • Replies 224
  • Created
  • Last Reply

Top Posters In This Topic

Thanks Jonathan.

 

When I use "print_r($bin)" with three test products I get "Array ( [products_bin_number] => BIN1 ) Array ( [products_bin_number] => BIN6 ) Array ( [products_bin_number] => BIN1234 )".

 

The BIN1, BIN6, and BIN1234 is what I want displayed on the packing slip, but "Array" is displayed instead.

 

Here is the code I am using in the packing slip template:

// GET BIN NUMBER FROM DATABASE
$order_model = $order->products[$i]['model'];
$bin_query[i] = tep_db_query("SELECT products_bin_number FROM " . TABLE_PRODUCTS . " WHERE products_model = '$order_model'");
$bin_number[i] = tep_db_fetch_array($bin_query[i]);
print_r($bin_number[i]); // print contents of the array to the screen.

// BEGIN WRITING ORDER TABLE CONTENTS
$pdf->addText($x,$pos,TABLE_HEADER_FONT_SIZE, $bin_number[i]);

Any suggestions?

 

 

If your array looks like this:

$bin_number[i]  contains "Array ( [products_bin_number] => BIN6 )"

 

Then try referencing the values like this:

$whatyouwant  =  $bin_number[i][products_bin_number]

Jonathan Duncan

JKD Web Magic

Web Site Hosting and Design

http://www.jkdwebmagic.com/

Link to comment
Share on other sites

It works! Thank you Jonathan for your help.

 

Here's the new code block that I'm using now. Hopefully it will be beneficial to someone with a similar problem.

// GET BIN NUMBER FROM DATABASE
$order_model = $order->products[$i]['model'];
$bin_query[i] = tep_db_query("SELECT products_bin_number FROM " . TABLE_PRODUCTS . " WHERE products_model = '$order_model'");
$bin_number[i] = tep_db_fetch_array($bin_query[i]);
$bin = $bin_number[i][products_bin_number];
//print_r($bin_number[i]); // print contents of the array to the screen.


// BEGIN WRITING ORDER TABLE CONTENTS
$pdf->addText($x,$pos,TABLE_HEADER_FONT_SIZE, $bin);

Thanks again Jonathan.

Link to comment
Share on other sites

  • 2 months later...

I have just installed Batch Print Center but everytime I get this error:

 

1054 - Unknown column 'o.orders_prefix' in 'field list'

 

select o.orders_id,o.orders_prefix,h.comments,MIN(h.date_added) from orders o, orders_status_history h where o.orders_id in (1859) and h.orders_id = o.orders_id group by o.orders_id

 

[TEP STOP]

 

Does anyone know how to solve?

Edited by rjongen
Link to comment
Share on other sites

That version is only to be used by people with contribution 1601 -Order_Number_Prefixe- installed .

 

Try using the previous version of batch print center.

Edited by radders
Link to comment
Share on other sites

That version is only to be used by people with contribution 1601 -Order_Number_Prefixe-  installed .

 

Try using the previous version of batch print center.

Okay, thank you.

It is working now.

 

Another question: Is it possible that the contribution is not printing a .pdf but the invoice I have created in osCommerce, the admin/invoice.php?

 

Because I have manually editted a lot to the invoice.php..

 

Thanks in advance! B)

Link to comment
Share on other sites

Hello,

Thank you for your great Contributions. however i run into this little problem after i input everything and hit "SEND"

 

1054 - Unknown column 'o.orders_prefix' in 'field list'

 

select o.orders_id,o.orders_prefix,h.comments,MIN(h.date_added) from orders o, orders_status_history h where o.orders_id in (1) and h.orders_id = o.orders_id and o.orders_status = 1 and h.orders_status_id = 1 group by o.orders_id

 

[TEP STOP]

 

 

Please help.

 

Thank you

Link to comment
Share on other sites

Another question: Is it possible that the contribution is not printing a .pdf but the invoice I have created in osCommerce, the admin/invoice.php?

 

Because I have manually editted a lot to the invoice.php..

 

Thanks in advance!  B)

 

You would need either to use a different contribution or to make a new template for this contribution which mimics the changes you have made.

Link to comment
Share on other sites

I have been using Batch Print Center 1.1 for about 6 months without a hitch, and all of a sudden I get this,

 

Program Message:

There were no orders selected for export, try changing your order options.

 

I have plenty of orders waiting with the status of processing but..

 

So, I went ahead and upgraded to BPC 3.1 and the same thing. I did install one contribution prior to this problem, Admin Send Password V1.1 , but there was only one core file change, customers.php. So, I uninstalled that and still the same thing..

 

Can someone help me?

 

btw, super props to the author of this fine contribution, prior to it not working it saved us so much time, hence why we are freakinout :)

James Scheller

Link to comment
Share on other sites

Ya, its pretty strange. I figured it wasn't in the coding because of the sudden nature of which it happened but was hoping someone may have seen this before and could suggest a fix.. but looks like doing it by order number will work just fine.

 

Can I comment out the date ranges so that they won't show and only allow for order numbers to process the batch? If thats possible, can I have it always show a pre-defined set of order numbers, 1000-3000?

James Scheller

Link to comment
Share on other sites

Also, here is a screen shot of my last problem.

 

osc.jpg

 

1) How do I pass the cut off information to the next page?

2) How do I get all the text to align correctly.

 

Thanks so much for your help!

 

Jaymz

James Scheller

Link to comment
Share on other sites

I suspect that you are not using A4 paper. In that case you need to adjust the dimensions of the paper and also the top of paper setting --look for something like

$y=810;

after the definitions in the template file.

 

Also you need to include (around line 320) in the section headed:

 
// Sort through the products

Put it just after 'pos' is calculated in order to stop you losing the bottom of the order list:

 

//page feed
if ($pos <= 30) {
$pdf->ezNewPage();
$pos =780;
}
// end page feed

Edited by radders
Link to comment
Share on other sites

  • 3 weeks later...

I get this error, just installed Batch print order 3.1:

 

Warning: main(BATCH_PRINT_INCbatch_print_header.php): failed to open stream: No such file or directory in /home/.rambunctious/stardog/stardogshop/admin/batch_print.php on line 140

 

Warning: main(BATCH_PRINT_INCbatch_print_header.php): failed to open stream: No such file or directory in /home/.rambunctious/stardog/stardogshop/admin/batch_print.php on line 140

 

Fatal error: main(): Failed opening required 'BATCH_PRINT_INCbatch_print_header.php' (include_path='.:/usr/local/lib/php') in /home/.rambunctious/stardog/stardogshop/admin/batch_print.php on line 140

 

Anybody who knws the solution for this?

 

Thanx in advance,

 

Matt

Link to comment
Share on other sites

  • 1 month later...

I am having trouble with the label template.

 

I am trying to print labels from a range of orders. The problem is that it leaves off the first one. Or if I try to print just one label using the order id number I get a blank pdf.

 

Has anyone else seen this problem?

Link to comment
Share on other sites

Warning: main(BATCH_PRINT_INCbatch_print_header.php): failed to open stream: No such file or directory in /home/.rambunctious/stardog/stardogshop/admin/batch_print.php on line 140

 

Warning: main(BATCH_PRINT_INCbatch_print_header.php): failed to open stream: No such file or directory in /home/.rambunctious/stardog/stardogshop/admin/batch_print.php on line 140

 

Matt,

 

about line 146 you will find this block of code

 

require(BATCH_PRINT_INC . 'batch_print_header.php');
require(BATCH_PRINT_INC . 'batch_print_body.php');
require(BATCH_PRINT_INC . 'batch_print_footer.php');

 

and before that around line 64 you should find

 

require(DIR_WS_CLASSES . 'currencies.php');
require(BATCH_PRINT_INC . 'class.ezpdf.php');
require(DIR_WS_CLASSES . 'order.php');

 

looks like you are missing something having to do with the "BATCH_PRINT_INC" defined variable

 

the easiest fix would be to upload a clean version of the batch_print.php file again.

 

But the error message tells you that it cannot parse BATCH_PRINT_INC so there is a problem with the sections of code that refer to that.

Link to comment
Share on other sites

Warning: main(BATCH_PRINT_INCbatch_print_header.php): failed to open stream: No such file or directory in /home/.rambunctious/stardog/stardogshop/admin/batch_print.php on line 140

 

Usually caused by bad configuration. Either the batch_print_header.php isn't on your server or you have a path set wrong so the main script can not find the file in question.

 

cheers

shaun

 

I am having trouble with the label template.

 

I am trying to print labels from a range of orders. The problem is that it leaves off the first one. Or if I try to print just one label using the order id number I get a blank pdf.

 

Has anyone else seen this problem?

 

As stated in the known-issues.txt file currently the label system has bugs.

Like the missing the lowest label number. The work around is to choose 1 label more then you want and the label program will drop that first label giving the labels you want.

 

The blank pdf is again the label program dropping the first label and if you only have 1 chosen then you will see a blank .. so choose 2 and again the program will drop 1 giving you just the label you wanted.

 

I simply don't have the time to find the issue with this and to date no one has offered to recode it to work correctly.

 

cheers

shaun

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...