Jump to content

Printed Receipts


Recommended Posts


I have a small issue with printing receipts!

In Orders screen i go to the end of the row of the order and print the order. This takes me to a screen like a Print Preview.

If you print it Prints 2 Pages. 1 with the actual receipt and the other page is blank with just the address of the location on the bottom. Its very anoying!!!!

How can i get rid of the second blank page or print the same receipt out twice... one for the customer and one for our records?



Link to comment
Share on other sites

  • 5 months later...

CubeCart sends a page that is meant to be printed. Unfortunately, I believe the size is intended for a specific form stock based on UK.A4 sizing, not US.Letter.


When the page arrives, cancel the Print Dialog window, then use the browser's "Print Preview" function. This should verify what the page gets printed as -- two pages or one. (And, of course, the number of items on the Order Invoice directly relates to the length of the document.)


You may have to work on the file adminskinsdefaulttemplatesorders.print.php and the css file adminstylesprint.css.

Link to comment
Share on other sites

Hi Bsmither,

Thanks for your reply and I think this right when you say it is based on the UK A4. How do I change it though, I have traced through orders.print.php and print.css but unfortunately I am unable to see where the form length is defined. What I need is to be able to have an Australian A4 form which is 210mm x 297mm. I understand that if there are multiple items that will require 2 pages then it will create 2 pages thats OK but when there is only enough items for 1 page then my client wants see only 1 page. I hope you can point me in the right direction and again thanks for your help.

Link to comment
Share on other sites

Using the browser's "Print Preview" function, have you confirmed that there is, in fact, two pages that will be printed?


Also, if your browser has a "Shrink to Fit" (on the printed page as defined in the browser's print setup), what affect does that have?

Link to comment
Share on other sites

Hi Bsmithers,

I checked the print preview as you suggested and yes it shows 2 pages and it only prints the order receipt number on page 2. Therefore I tried another order to print and this time it the order had a coupon on it and this caused the order invoice number to be printed at the top of page 2 then the company logo and the return address and then the discount code that was used. I have checked the shrink to fit and still have the same problem. It just thinks the page is shorter than it really is so if we can lengthen the page this should solve the problem and only print the 2nd pages when it absolutely needs to, that is lots of items on the order/invoice.

Hope you can help me.

Link to comment
Share on other sites

When you say it prints the order receipt number, please verify that what you are actually seeing is the Title of the browser document (the <title> tag in the <head> section of the HTML). Browsers show the document title in the browser window's title bar, and also, the browser's printer settings will place the document title in the header (or footer) along with the web address of the document, as well as page x of y and date printed in the footer.


Please keep in mind that the following does not apply to me, because when I Print Preview an invoice, FireFoxv21 says I have 1 of 1 pages. So your browser must interpret the page-break differently.


In the file order.print.php, there is this:

<body onload="window.print();">
  {if isset($ORDER_LIST)}
  {foreach from=$ORDER_LIST item=order}
  <div class="page-break">

This div encloses the entire page (but not the following "Notes" page -- mention of a coupon constitutes a 'note') and its class requires a page-break after this block. I think this is wrong. Let's experiment:


Comment that div tag.

<!-- <div class="page-break"> -->


Comment its closing tag.

<!--  </div> -->
  {if !empty($order.notes)}

Change this by adding the new line:

  {if !$order@last}<div class="page-break"></div>{/if}



The new line says, "If this is not the last invoice from the set of invoices to print, then start a new page." That is, if it is the last invoice, do not start a new page.


Ok, just tried it with Internet Explorer (shudder) version 6 (double-shudder) and it wanted to print two pages.


"I tried another order to print and this time it the order had a coupon on it and this caused the order invoice number to be printed at the top of page 2 then the company logo and the return address and then the discount code that was used."


So, when this second page (a legitimate second page for notes) was printed, was there a third page that was blank? Because for the same reason a follow-on blank page gets printed after the details page, there should be a follow-on blank printed after the notes page.

Link to comment
Share on other sites

Hi Bsmither,

I made the changes you have suggested but unfortunately this caused a completely no display at all. Was I supposed to remove the '{if !empty($order.notes)} or was I just to add the new line. The other thing I tried after resetting the coding to the original was to enter multiple product lines and a discount coupon to see what the result was. The result was that there was a legitamate 2 pages, but there was also a extra page break and that I think was caused by the discount coupon as that was on the 3rd page. Maybe we should be looking at the discount coupon is the one causing the problem. Otherwise is there a way of increasing the page size in length.

This is causing some grief as you can imagine, thanks for the help happy to experiment some more

Link to comment
Share on other sites

Having no display meant some line was removed that was not supposed to have been removed.


"Was I supposed to remove the '{if !empty($order.notes)}?"


No. I included that line as an indicator for which </div> was supposed to be commented.


The HTML for the Notes page gets created only if there are notes to be printed.

Link to comment
Share on other sites

Hi Bsmithers

Sorry it has taken a long time to respond but I decided revisit your suggestion and when I entered the suggested code correctly it seemed to solve to issue I also believe that the coupon should not skip to a new page is there any way we can prevent this happenning.

Your suggestions will be appreciated and thanks for the continued help.

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.

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