Skip to content

Instantly share code, notes, and snippets.

@stephaneerard
Created April 25, 2011 14:44
Show Gist options
  • Select an option

  • Save stephaneerard/940607 to your computer and use it in GitHub Desktop.

Select an option

Save stephaneerard/940607 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
(function($){
var printProcess = function(){
var imgSrc = '<?php echo $product->getTicketGeneration()->get('Image')->getFullWebPath()?>';
var subWnd = window.open('', 'stayTicketPrinterWindow', 'width=1024,height=800,resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
if($('img', subWnd.document.body).size() === 0)
{
var imgTag = $('<img/>').attr('src', imgSrc);
$(subWnd.document.body).append(imgTag);
}
subWnd.print();
}
$('a.print').click(printProcess);
printProcess();
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment