Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I am trying to make a javascript button to launch a popup window without url bar (to display a printable invoice with no order number in the url bar). I am not proficient at java, and have not been able to get it going right, so I am looking for help. This is the original link:

 

<?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_PRINTABLE, tep_get_all_get_params(array('order_id')) . 'order_id=' . $HTTP_GET_VARS['order_id'], 'SSL') . '" TARGET="_blank">' . tep_image_button('print_button.gif', IMAGE_BUTTON_PRINT_ORDER) . '</a>'; ?>

 

Thanks in advance!

  • 2 weeks later...
Posted

Hi there....

 

For a specific gastronomic project, my client requested me to prepare printable pages for each and every available menu. I have two possibilities :

 

A.

1. I click a button, which opens a pop-up window without Location, Menubar,...

 

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

function popupWindow(url) {

 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizab
le=no,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=15
0')

}

//--></script>



...



<?php echo '<a href="javascript:popupWindow('' . tep_href_link(FILENAME_ORDERS_PRINTABLE, tep_get_all_get_params(array('order_id')) . 'order_id=' . $HTTP_GET_VARS['order_id'], 'SSL') . '')">' . tep_image_button('print_button.gif', IMAGE_BUTTON_PRINT_ORDER) . '</a>'; ?>

 

2. Inside the code of the page to be printed, I put this :

 

<div id="print" style="position:absolute; left:285; top:45; visibility:visible; z-index:0;"> 

<A HREF="javascript:window.print()"><IMG SRC="images/print.gif" ALT="Print Menus" BORDER="0"></A>

</div>

 

This puts a "Print" button on that page that I can click to launch the printing.

 

B.

1. I click a button, which opens a pop-up window without URL, Menubar,...

(same code as above).

2. Inside the code of the page to be printed, I put this :

 

<BODY onLoad="window.print();">

...

 

This automatically launches the printing (i.e. open the printing dialog box...) at the openning of the pop-up window.

 

I hope this helps.

 

Paulo.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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