Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order Printing


AngFerFer

Recommended Posts

Posted

I would like to set a buttom or something for the customers to print orders in my shop.

 

I have seen a order print add-on in this same forum, and after installing and testing it, I must say that I do not like it.

 

I would like something very very simple, with no installations in different pages or modifications.

 

Is it possible?

 

Thanks very much.

Posted

For printing the page with an order? Why not a javascript print button?

 

In account_history_info, find this:

 

<div class="buttonSet">

<?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_ACCOUNT_HISTORY, tep_get_all_get_params(array('order_id')), 'SSL')); ?>

</div>

 

Then insert another selector, after <div class="buttonSet"> or within it as you think fit.

 

For instance <div class="print-buttom">

 

And then, insert the javascript code and the link with the buttom:

 

THE SCRIPT

 

<script>

<!--

function doit(){

if (!window.print){

return

}

window.print()

}

//-->

</script>

 

THE BUTTOM

 

<a href="javascript:doit()"><img src="images/print-buttom.gif" border="0"></a>

 

ALL OF IT

 

<div class="print-buttom">

<script>

<!--

function doit(){

if (!window.print){

return

}

window.print()

}

//-->

</script>

</div>

 

In any case, it is a bit useless, because everybody knows how to print a page.

 

Regards.

 

José Manuel Rosón Bravo

Posted

Thank very much José Manuel. The print buttom works very well with your code, but it prints all the page, and I would like to have just the order, not the whole page.

 

Is there some solution?

 

Many thanks indeed.

Posted

You can write extra css code to create a specific style for printing, removing all the elements having nothing to do with the order itself on the page. A solution that enables you to take into account even issues related to typography, the inclusion of images or a logo specially designed or included for the printing version of the page, etc.

 

There are three different way to get it:

 

@media rules

 

A direct way to specify the media to which the css style is applied.

 

Example:

 

To delete all the elements within headerShortcuts in the php file from the page:

 

After the #headerShortcuts in stylesheet.css, write:

 

@media print {

#headerShortcuts { display: none; }

}

 

This way, the headerShortcuts id selector and all of its contents disappear from the printed page.

 

The same with all the other elements you what not to show in the printed order, leaving just the logo, the element related to the order itself within the contentContainer selector.

 

@media print {

#columnRight { display: none; }

}

 

(……………………………)

 

@media print {

.buttonSet { display: none; }

}

 

After each element in the css code.

 

@import rules

 

To link external css files with specific rules for different media.

 

Example:

 

@import url("print-styles.css") print;

 

Then create and edit the print-styles.css file, and upload it to the proper folder.

 

Specific Link Tags

 

Just add a specific link to a css to format the printed order as you think fit.

 

Thus, in includes/application_top.php:

 

After:

 

<link rel="stylesheet" type="text/css" href="stylesheet.css" />

 

Insert:

 

<link rel="stylesheet" type="text/css" media="print" href="print-styles.css" />

 

media="print" tells us that the style applies just to print.

 

Regards.

 

José Manuel Rosón Bravo

Posted

Would it not be possible for you to alter one of the print order add ons that are available for version 2.2 to fit your needs.

REMEMBER BACKUP, BACKUP AND BACKUP

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...