Developers

  1. Modify Css / Styles / Layout
    1. Layout (Menu Items, General)
    2. Frontend Css
    3. Admin Css
  2. Templates
    1. Pages
      1. page.order.php
      2. page.confirm-order.php
      3. page.processing.php
      4. page.thankyou.php
      5. page.cancelled.php
      6. page.purchase-history.php
    2. Order
      1. itemised.php
      2. summary.php
      3. transaction_details.php
    3. Global
      1. orderinfo.php (Widget)
      2. openingtimes.php (Widget)
      3. additives.php (Widget)
      4. navigation.list.php (Widget)
      5. navigation.dropdown.php (Widget)
      6. search.php (Widget)
      7. totals.php (Widget)
      8. pickup_choice.php (Mixed)
      9. login.php (Module)
      10. profile.register.php (Module)
      11. profile.update.php (Module)
      12. pages.pickup_note.php (Module)
      13. formfields.inputs.php (Module)
      14. formfields.values.php (Module)
    4. Cart
      1. cart.container.php
      2. cart.shopclosed.php
      3. cart.empty.php
      4. cart.pickup_note.php
      5. cart.checkout_button.php
      6. cart.empty_cart_button.php
      7. cart.minimum_order.php
      8. minicart.php
    5. Loop (Menu Items)
      1. header.php
      2. no_results.php
      3. posts.title.php
      4. posts.thumbnail.php
      5. posts.prices.php
      6. posts.content.php
      7. posts.permalink.php
      8. additives.php
      9. pagination.php
      10. theme-wrapper.php
    6. Search Results
      1. search.php
    7. Single Menu Item
      1. single.php
    8. functions.php
  3. Filters, Actions, Functions
    1. Global WPPizza functions
    2. WPPizza options (Filter)
    3. Currency (Filter)
    4. After every order (Action)
    5. Getting orders (Function)
  4. Constants
    1. Admin Name
    2. Admin Menu Icon
    3. SORT_ITEMS_AS_ADDED
    4. SINGLE_PERMALINK_VAR
    5. WIDGET_CSS_CLASS
    6. PLAINTEXT_LINE_LENGTH
    7. ADMIN_{CONSTANTS}
    8. DEV_{CONSTANTS}
    9. INSTALL_{CONSTANTS}
    10. TRANSACTION_{CONSTANTS}
  5. Codesnippets
    1. Create your own sales report
    2. Order history - todays orders
    3. Email/Print templates
    4. Email Subject Line
    5. Add attachment to email
    6. On order status update
    7. Unconfirmed orders
    8. Customise order id
    9. Changing post type arguments
    10. Gateway filter frontend
    11. Users previous orders
    12. Dynamic menu item prices
    13. Update prices in bulk
    14. Prices output loop
    15. Pickup opening times
    16. Checkout Formfields
    17. Additional validation function
  6. Extensions / Gateways
    1. Add Ingredients
    2. Autoprint
    3. Confirm | Reject | Notify
    4. Coupons and Discounts
    5. Cross-Sells
    6. Delivery By Post/Zipcode
    7. Goodcom Printer
    8. Mailinglists
    9. Pdf Invoices
    10. Preorder
    11. Gateway - Stripe

6.2.Autoprint

Customisations WPPizza Autoprint

Adjusting print output of selected autoprint template

Your print template selected MUST be set to “Html” to be able to access the css setting

  • Go to “Wppizza -> Templates -> Print”
  • Locate the template you have selected to use as your autoprint template
  • Make sure this template is set to Type->HTML
  • Click on the “code” icon to reveal the “Print Order CSS”
  • Edit/Adjust the css as required
  • To add header/footer – or other – images to the template, see the examples below, adjust as required and add to your css declarations
//some examples regarding logo top, a logo above summary, a logo below summary, assuming logo height is about 60px (alse adjust padding as required
//logo top
body {
	background-image: url("http://www.domain.com/[somepath]/logo.png");
	background-repeat: no-repeat;
	background-position: center top;
	padding-top:60px;
}
//logo above summary
#summary {
	background-image: url("http://www.domain.com/[somepath]/logo.png");
	background-repeat: no-repeat;
	background-position: center top;
	padding-top:60px;
}
//logo below summary
#summary {
	background-image: url("http://www.domain.com/[somepath]/logo.png");
	background-repeat: no-repeat;
	background-position: center bottom;
	padding-bottom:60px;
}
//enter something in "Footer : text after summary / totals" in wppizza -> localization and add the logo as in the css examples above
//footer localization must not be empty - alternatively simply enter the html in the textbox itself and ignore the css below
#footer {
	background-image: url("http://www.domain.com/[somepath]/logo.png");
	background-repeat: no-repeat;
	background-position: center bottom;
	padding-bottom:60px;
}

wppizza_autoprint_filter_page_format

@param: array
@return: array

add_filter('wppizza_autoprint_filter_page_format', 'myprefix_autoprint_filter_page_format');
function myprefix_autoprint_filter_page_format($pageFormat){

	/* adding your own page format for example */
	$pageFormat['my_format] = array(
		'label' => 'My Format Label',//set some label to identify this in the dropdown
		'paper_size' => array(0, 0, 226.77, 'single'),//in points (example here equates to 80mm x 160mm) if 4th parameters is set to single - as opposed to a distinct height in points - , height will be calculated for single page
		'page_margin' => array(0.1, 0.4),//in cm (top/bottom, right/left) [1cm == 28.3465 pt]
		'page_height_adjustment' => 20, // when forcing single page add an additional value - just to be safe to the calculated pageheight to account for margins.
		'orientation' => 'portrait',//portrait or landscape
		'font_size' => array(6.5, 6.5),//fontsizes - in points - for monospaced/plaintext and html
		'cpl_monospace' => 50,//by default it's 70 characters per line for plaintext templates, this might be too long (depending on font and paper sizeset , so this might need to be less than 70
		'thermal' => true,//if its a thermal printer you want to use this template for

	);
return $pageFormat;
}

wppizza_autoprint_filter_printnode_options

dynamically alter printnode options

@param: array
@param: array
@return: array

add_filter('wppizza_autoprint_filter_printnode_options', 'myprefix_autoprint_filter_printnode_options');
function myprefix_autoprint_filter_printnode_options($printnode_options, $order_details){

	/* 
		example:
		alter the  api key depending on some order value 
	*/
	if($order_details['ordervars']['{some-order-value}']['value'] == 'some value'){
		
		$printnode_options['printnode_api_key'] = 'abcdefg....';
		
	}
	
	/* 
		example:
		alter the printnode printer ids 
		(i.e in this example change printer ids to '123456,789456' instead of what is entered in the plugin settings)
		depending on some order value 
	*/
	if($order_details['ordervars']['{some-order-value}']['value'] == 'some value'){
		
		$printnode_options['printnode_printer_ids'] = '123456,789456'; 
		
	}	
	
	

return $printnode_options;
}

wppizza_autoprint_filter_printnode_id

dynamically change one of the “Printnode ids” you are printing to (make sure your Api Key is valid for this print id !)

@param: str
@param: array
@return: str

add_filter('wppizza_autoprint_filter_printnode_id', 'myprefix_autoprint_filter_printnode_id');
function myprefix_autoprint_filter_printnode_id($printnode_id, $order_details){

	/* 
		example:
		alter the printnode printer id to 987654 if $order_details 
		is some value and original printer id 
		is 123456
	*/
	if($order_details['ordervars']['{some-order-value}']['value'] == 'some value' && $printnode_id = '123456'){
		
		$printnode_id= '987654';
		
	}
	


return $printnode_id;
}

Default css for Autoprint template added on install (in case you would like to reset this to the defaults)

Please note that the absolute font-size will automatically added to this css depending on your plugin settings, therefore the default font-size values are deliberately relative (i.e percentages) here, though you can set things as you wish…

	html, body, table, tbody, tr, td, th, span{margin:0; padding:0; text-align:left;}
	table{width:100%;margin:0 auto 10px auto;}
	th{padding:5px;border-top:2px solid;border-bottom:2px solid;font-size:120%;white-space:nowrap;text-align:center}
	td{padding:0 5px;vertical-align:top;}
	#header tbody > tr > td{text-align:center;padding:0;}
	#header #site_name td{font-size:250%;}
	#header #site_url td{font-size:100%;padding-bottom:5px;}
	#header #site_header td{font-size:130%;}
	#header #site_address td{font-size:130%;}
	#overview {table-layout: fixed;}
	#overview tbody > tr > td{width:50%;word-wrap: break-word;white-space: initial;}
	#overview tbody > tr > td:first-child{text-align:right}
	#overview tbody > tr > td.td-ctr{text-align:center;width:100%;}
	#overview #order_date td {border-top: 2px solid; border-bottom: 2px solid; font-size: 120%; text-align: center;padding: 5px;}
	#overview #order_id td{font-size:140%}
	#overview #payment_due td{font-size:140%}
	#overview #pickup_delivery td{font-size:120%;white-space:normal;text-align:center;width:100%;}
	#overview #self_pickup td{font-size: 120%;padding: 10px 0;}
	#overview #admin_notes td{white-space:normal;text-align:center; width:100%; padding:10px 0;}
	#customer tbody > tr > td{white-space:inherit;}
	#customer tbody > tr > td:first-child{white-space:break-spaces;}
	#order th{text-align:left}
	#order th:first-child,#order th:last-child{width:20px;white-space:nowrap;}
	#order tbody > tr.items > td{padding-top:5px;font-size:100%; word-break:break-all}
	#order tbody > tr.items > td:first-child{text-align:center;word-break:initial}
	#order tbody > tr.items > td:last-child{text-align:right;white-space:nowrap;word-break:initial}
	#order tbody > tr.divider > td > hr {border:none;border-top:1px dotted #AAAAAA;}
	#order .item-blog td{padding:5px 2px 5px 2px; border-bottom:1px solid;font-weight:600;font-size:120%}
	#order .item-category td{padding:5px 2px 2px 2px; border-bottom:1px dashed }
	#summary {border-top:1px solid;border-bottom:1px solid;}
	#summary tbody > tr > td{text-align:right}
	#summary tbody > tr > td:last-child{width:1%;white-space:nowrap;}
	#footer #footer_note td{text-align:center;width:100%;}
Suggest Edit

documentor id 5