Jump to content

[Resolved] Cannot fix the height of the print invoice template


Recommended Posts

Hi,

I have spent many hours improving my "print invoice", the one you can print from admin, not the one the customer can print from the website. However, I am facing a constant headache. The header does not stop changing height depending on the number of product listed below into the "info" div, so none of my invoices are identical from a header point of view.

The 2 files concerned are:  /admin/skins/default/templates/orders.print.php with the css file /admin/skins/default/styles/print.css

I have tried all sorts in the css to add a height for the header but nothing I actually modified in that css seems to have an impact on the print.php file which I found very strange.

I ended up making style modifications into the php file, not all good practice, like div spacer, etc ...

So does anyone know how to fix that issue or maybe there is another css file that actually overpowers the print.css which would explain why none of my changes are working ?

Thanks

S.

Link to comment
Share on other sites

Please keep in mind that the browser that receives the order.print.php rendered file will likely have cached the print.css file. So, no matter if edited, unless the browser is 'tricked' into loading this file all the time (as opposed to using the copy in its cache), nothing changes.

Feel free to post copies of those files here, or ZIP them up and make them available for download from some site. We can take a look.

 

If the browser using the copy in its cache is the problem, try:

In orders.print.php, find:

<link rel="stylesheet" href="../{$SKIN_VARS.admin_folder}/skins/{$SKIN_VARS.skin_folder}/styles/print.css" media="screen,print">

Change to:

<link rel="stylesheet" href="../{$SKIN_VARS.admin_folder}/skins/{$SKIN_VARS.skin_folder}/styles/print.css?v={$smarty.now}" media="screen,print">

This adds the current epoch timestamp to a querystring. It's guaranteed to be unique, (supposedly causes all caching mechanisms from your browser to CubeCart inclusive to to be bypassed, and is completely ignored. That is, will not affect what the web server sends back.

Link to comment
Share on other sites

Thanks bmither.

Tried the above coding, was not working with firefox but chrome OK only once per page. After that, the page was constantly trying to refresh rending only a blank page so I had to remove the code and I kept clear the browser cache instead, working fine.

Also different browsers, different behaviours. Has been a little stressful but now I can see my changes by amending the css file which is the main thing and my header is finally fixed so super happy. I put the customers' comments into fieldset as well to look consistent but noticed that the order "Public Note Content" notes coding is missing on the print invoice so off I go looking for that now .... never stops :-)

S.

 

Edited by sailing123
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
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...