[TYPO3-shop] question for coders

Leen Strijk leenstrijk at tomaatnet.nl
Tue Mar 11 16:45:34 CET 2008


Hi,

I'm working on the ext mbi_products_orders
I changed the function printOrder($order) in the index.php file, to add 
a "print invoice" button. (see code below)

I now see a print button in the orders module.
When i click this I can make a hardcopy print of the order.(might be 
usefull for invoices)
But when it prints it puts out an empty sheet aswel as the order.

Are there ana idea's on how to prevent this?




	function printOrder($order) {
	  $query = $GLOBALS['TYPO3_DB']->SELECTquery(
					  '*',
					  'sys_products_orders',
					  'uid='.$order);
	  $res = $GLOBALS['TYPO3_DB']->sql_query($query);

	  if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
		 $orderData = unserialize($row['orderData']);
		 $content = '
		 <style type="text/css" media="print">
		<!--
		.print {
			visibility: visible;
			}
		.typo3-mediumDoc {
	          visibility: hidden;
			}
		body {
		visibility: hidden;
		}
		-->
</style>
			<style type="text/css">
				/*<![CDATA[*/
					.shop-basket-table {
						width: 100%;
						padding-top: 20px;
						font-size: 100%;
					}
					.body {
					visibility:hidden;
					}
					.print {visibility:visible;}
					.shop-basket-table th {
						color: #2033ac;
						font-weight: bold;
						font-size: 120%;
					}
					.shop-payment-address-table th {
						color: #000000;
						font-weight: bold;
						font-size: 10px;
						text-align: right;						
					}
					.shop-basket-price {
						text-align: right;
					}
					.shop-basket-item-quantity {
						text-align: right;
					}
					.shop-basket-header {
						color: #2033ac;
						font-weight: bold;
						padding-top: 20px;
						font-size: 120%;
					}
					.shop-basket-total-price {
						font-weight: bold;
					}
				/*]]>*/
			</style>
			<table class="print" cellpadding="10" cellspacing="0" border="0" 
bgcolor="#ffffff"
				width="100%" style="border: 1px solid #000000">
				<tr>
					<td>'.$orderData['html_output'].'</td>
				</tr>
			</table>
			<form><br />
			<input type="button" value=" Print this invoice "
onclick="window.print();return false;" /></form>';
		 //		 $content.= t3lib_div::view_array($orderData);
	  }

	  return $content;
	}


More information about the TYPO3-project-tt-products mailing list