Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Mass printing of new orders?


Guest

Recommended Posts

I must apologize to everyone, I zipped this mod initially on my Mac OS X machine. Then zipped it off of that computer and uploaded the mod. I decided to download the mod off the contributions site and install it on a new fresh test install that I was going to use as my official test installation when I got a whole slew of parse errors. I converted all the files to straight ascii, tried it again on the fresh OSC 2.2MS1 and it worked perfectly. A bad newbie mistake and I am no newbie, which makes it worse. Singspiel I uploaded the new archive let me know if you have any problems with the update.

Link to comment
Share on other sites

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Frederico, thanks a lot for this great contribution which is saving me so much time. I've been trying to add e-mailing functionality in order to auto-notify my customers about the change of status of their orders. I tried to adapt the function in orders.php and integrate it in batch-print.php where specified, but I didn't succeed.

Could you give me a hint what to do, or has anybody succeeded in integrating this functionality yet?

 

Pat

Link to comment
Share on other sites

Added the ability to auto notify customers via email, please see the update to the contribution. let me know if you run into any problems with the mass e-mail, I ran many tests on a clean installation to make sure everything was included. LMK

Link to comment
Share on other sites

Frederico, I look forward to giving it a try. What are the changes that need to be made to application_top.php and english.php? I have 30 contributions instaleed so can't just replace them.

Link to comment
Share on other sites

Dow! Yea those files are main files that keep track of alot of global vars. Point taken! I should include what the actual changes are in those files with the zip. Thanks for the heads up, in the mean time, that changes are as follows:

 

In english.php

 

Under the tools menu

// tools text in includes/boxes/tools.php

define('BOX_HEADING_TOOLS', 'Tools');

define('BOX_TOOLS_BACKUP', 'Database Backup');

define('BOX_TOOLS_BANNER_MANAGER', 'Banner Manager');

define('BOX_TOOLS_CACHE', 'Cache Control');

define('BOX_TOOLS_DEFINE_LANGUAGE', 'Define Languages');

define('BOX_TOOLS_FILE_MANAGER', 'File Manager');

define('BOX_TOOLS_MAIL', 'Send Email');

define('BOX_TOOLS_NEWSLETTER_MANAGER', 'Newsletter Manager');

define('BOX_TOOLS_SERVER_INFO', 'Server Info');

define('BOX_TOOLS_WHOS_ONLINE', 'Who's Online');

/* Add This */ define('BOX_TOOLS_BATCH_CENTER', 'Batch Order Center');

 

In application_top.php

 

Under the note below there are a whole slew of defined

file names. Anywhere in that list just add the one line below.

 

// define the filenames used in the project

define('FILENAME_BATCH_PRINT', 'batch_print.php');

Link to comment
Share on other sites

I have a weird problem not discussed here yet. I don't have any error messages and the PDF get's created but things are not aligned in the header....lotsa overlap, etc.... here is a screen snapshop of the created PDF. I masked in red the customers information for protection but i think you get the gist of my problem:

 

 

 

batch.jpg

Link to comment
Share on other sites

I have a weird problem not discussed here yet. I don't have any error messages and the PDF get's created but things are not aligned in the header....lotsa overlap, etc.... here is a screen snapshop of the created PDF. I masked in red the customers information for protection but i think you get the gist of my problem:

 

 

 

batch.jpg

 

Me Too...

 

Warren

Link to comment
Share on other sites

I had that same problem with the initial release because the files had carrriage returns from being formatted on and zipped on a Mac. When I tried it and uploaded the files to the server with WS_FTP I got everything running together like you guys got in the image posted. The most current release is straight windows ascii and should not give you any problems, after I re-uploaded the "corrected" files, everything ran good again. Try downloading the most recent release, make sure everything gets uploaded ascii including the font files that have .afm extensions, and it should run correctly. If it doesn't, you got me :?: email me or PM me to see if we can't fix it.

Link to comment
Share on other sites

I had that same problem with the initial release because the files had carrriage returns from being formatted on and zipped on a Mac.  When I tried it and uploaded the files to the server with WS_FTP I got everything running together like you guys got in the image posted.  The most current release is straight windows ascii and should not give you any problems, after I re-uploaded the "corrected" files, everything ran good again.  Try downloading the most recent release, make sure everything gets uploaded ascii including the font files that have .afm extensions, and it should run correctly.  If it doesn't, you got me :?: email me or PM me to see if we can't fix it.

 

same error with the latest version. I am also on Mac but since I don't edit the files this should not be an issue. Which specifically did you have the carriage return problem with so i can double-check? I have done many mods and do a lot of PHP on my MAC and don't have issues....using dreamweaver....

 

Thanks!

Link to comment
Share on other sites

This is the batch_print.php file in plain ascii test from the archive admin.zip wich was uploaded on 5/19/2003.

clean.gif

 

This is the batch_print.php file in plain ascii text from the archive

BatchCenter.zip uploaded 5/09/2003

 

garble.gif

 

If the file looks like this last one in notepad, it is probably the reason the

output is garbled, and you will have to re-upload all of the files from the latest archive.

Link to comment
Share on other sites

My files are clean like yours. I have re-uploaded your latest contrib 3 times with same result. I think there might be another problem. Maybe a conflict with another contrib or setting?

Link to comment
Share on other sites

:?: Carrera, I don't know what it could be. I have a fresh install of MS1

and I removed all of the files/folders completely, reinstalled all of the files and I am do not have that problem. Short of giving me a limited FTP account to your host to try and track down the problem personally, I don't know if that is feasible because you don't know me from a whole in the wall. I will continue to try and recreate this error, but I am having no luck.

I will keep you posted.

Link to comment
Share on other sites

Ok I was able to re-create the problem using the initial release and trying to narrow down the problem. I installed the initial release on my test installation and I got the crash and burn version of the pdf that a couple of you are getting. When the PDF class creates the PDF in the temp_pdf folder, it creates two new font file conversions during operation. They are:

 

php_Helvetica-bold.afm

php_Helvetica.afm

 

If you install the most recent release and replace every file, but do not delete these font files created from the initial install, the PDF class will continue to use the same incorrectly formated font files to output a new PDF. My suggestions.

 

1. Get the latest release

2. Upload all the files, when you get to the temp_pdf folder make sure you upload all of the font files in ascii. If you see any files with the

"php_" prefix, DELETE those files.

The only files in a new install under the temp_pdf folder should be:

 

Helvetica.afm

Helvetica-Bold.afm

Helvetica-BoldOblique.afm

Helvetica-Oblique.afm

 

3. Run the script. The script will recreate the "php_" prefix font files with the correct formatting and the problem should be resolved.

Link to comment
Share on other sites

:?:  Carrera, I don't know what it could be.  I have a fresh install of MS1

and I removed all of the files/folders completely, reinstalled all of the files and I am do not have that problem.  Short of giving me a limited FTP account to your host to try and track down the problem personally, I don't know if that is feasible because you don't know me from a whole in the wall.  I will continue to try and recreate this error, but I am having no luck.

I will keep you posted.

Thanks. I don't think it's specific to my setup since there was another person a few posts up that has the same issues. If you have some troubleshooting tips I would be more than happy to play around a bit. Just send me a Pm or email.

 

Thanks!

Link to comment
Share on other sites

Ok I was able to re-create the problem using the initial release and trying to narrow down the problem. I installed the initial release on my test installation and I got the crash and burn version of the pdf that a couple of you are getting.  When the PDF class creates the PDF in the temp_pdf folder, it creates two new font file conversions during operation. They are:

 

php_Helvetica-bold.afm

php_Helvetica.afm

 

If you install the most recent release and replace every file, but do not delete these font files created from the initial install, the PDF class will continue to use the same incorrectly formated font files to output a new PDF. My suggestions.

 

1. Get the latest release

2. Upload all the files, when you get to the temp_pdf folder make sure you upload all of the font files in ascii.  If you see any files with the  

"php_" prefix, DELETE those files.  

The only files in a new install under the temp_pdf folder should be:

 

Helvetica.afm

Helvetica-Bold.afm

Helvetica-BoldOblique.afm

Helvetica-Oblique.afm  

 

3. Run the script. The script will recreate the "php_" prefix font files with the correct formatting and the problem should be resolved.

 

Jackpot! That's exactly what it was. works like a charm now! :D

 

Thanks Much!

Link to comment
Share on other sites

  • 2 weeks later...
I am ... working ... to have it present all the orders on one big page, instead of links to all the orders. It will use the CSS pagebreak to allow you to just print them.

 

Ok, this fell to the bottom of the To Do list, but it's done now. I modified edit_orders.php so that it dumps all the orders to the screen and uses the CSS page-break-after style to force page breaks when it prints.

 

Around line 69 locate:

           <script language="javascript"><!--

          function popupWindow(url) {

          window.open(url,'popupWindow','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=100, height=100, screenX=150, screenY=150, top=150, left=150')

          }

          //--></script>

         <a href="javascript:popupWindow('<?php echo tep_href_link('invoice.php?oID=' .$option[$p]); ?>')">Print Invoice for order # <? echo $option[$p]; ?></a><BR>

 

and replace it with:

<?php $myurl = tep_href_link('invoice.php?oID=' .$option[$p]);

     include $myurl;

     echo '<br style="page-break-after:always;">'."rn";

?>

 

You will likely want to do the same thing for the packing lists (around line 98 ) :

<?php $myurl = tep_href_link('packingslip.php?oID=' . $option[$p]);

     include $myurl;

     echo '<br style="page-break-after:always;">'."rn";

?>

 

This takes advantage of PHP's magic ability to inline http calls as includes and may not work on older versions of PHP.

jackhandy - http://jackhandy.com

Link to comment
Share on other sites

Hello jackhandy,

I assume you are talking about this modification relating to the Multiple Order Update contribution: http://www.oscommerce.com/community/contributions,1152

 

I tried you modification to get all my orders to print at once but I was returned with this error:

 

Warning: Failed opening 'https://www.mydomain.com/admin/invoice.php?oID=10' for inclusion (include_path='.:/usr/share/pear') in /home/usr/admin/edit_orders.php on line 70





Warning: Failed opening 'https://www.mydomain.com/admin/invoice.php?oID=9' for inclusion (include_path='.:/usr/share/pear') in /home/usr/admin/edit_orders.php on line 70

 

Do I need to change anything in your proposed code?

Link to comment
Share on other sites

I assume you are talking about this modification relating to the Multiple Order Update contribution: http://www.oscommerce.com/community/contributions,1152

That is correct, sorry, I should have specified such.

 

I tried you modification to get all my orders to print at once but I was returned with this error:

 

Warning: Failed opening 'https://www.mydomain.com/admin/invoice.php?oID=10' for inclusion (include_path='.:/usr/share/pear') in /home/usr/admin/edit_orders.php on line 70

 

Do I need to change anything in your proposed code?

 

Unless you doctored those errors to not reveal your actual domain, it appears that you have an invalid domain name. The PHP HTTP include requires a valid domain name or a call to localhost. (I tested on a Mac OS X box and implemented on a RH8 box both running Apache with PHP 4.3.0) You may be able to use the following (adjust paths as necessary):

 

<?php $myurl = 'https://localhost/admin/invoice.php?oID=' .$option[$p];

     include $myurl;

     echo '<br style="page-break-after:always;">'."rn";

?>

 

Otherwise I would take a close look at your configuration files for osC.

jackhandy - http://jackhandy.com

Link to comment
Share on other sites

Yeah,

I doctored the domain names...I am thinking the problem relates to my version of PHP. I am using PHP 4.1.2

 

On the php page you linked to regarding this function I found this warning:

 

Warning

Windows versions of PHP prior to PHP 4.3.0 do not support accessing remote files via this function, even if allow_url_fopen is enabled.

 

I don't know if this is exactly the function you are using but the paths to the inclusion files (packaging and invoice slips) are correct. And I do get the packaging and invoices to come up with the javascript pop-up function...

 

What does the feed-back error:

share/pear

refer to? Why pear? Aren't we using php as the programming language?

 

I am using a hosting company (an excellent one) and I will send in a request for a php update.

Link to comment
Share on other sites

What does the feed-back error:

share/pear

refer to? Why pear? Aren't we using php as the programming language?

 

PEAR is the PHP Extension and Application Repository, it provides a multitude of useful libraries along the lines of Standard Lib in C/C++, or Java Beans. PEAR is built into PHP, and I'm assuming that your earlier error was because PHP was trying to link to a PEAR library for the include. It sounds like a newer version of PHP might help you.

jackhandy - http://jackhandy.com

Link to comment
Share on other sites

jackhandy, I have the same error as TheFinnisher.

 

I am using PHP Version 4.1.2 on Redhat Linux. My url is definately correct, if I cut and paste the indiviual invoice links it works.

 

Is it something to do with calling remote files.

 

Any ideas?

 

Nev

Link to comment
Share on other sites

  • 1 month later...
jackhandy, I have the same error as TheFinnisher.

...

Is it something to do with calling remote files.

 

Any ideas?

 

I discovered that a few of the admin utilities out there will break my hack for getting multiple invoices to print properly, as the include() statement is making a fresh http request to the server from the server (and not the browser where a login cookie might reside). I am exploring a few options to use curl and/or including the content of the invoice or packing slip in Multi-Edit, itself.

 

So, in summary, you may have to hack your admin to allow multi-edit to call the invoice.php and packingslip.php to get my hack to work. :?

jackhandy - http://jackhandy.com

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...