/templates/print-order/print-content.php

  1. <?php 
  2. /** 
  3. * Print order content. Copy this file to your themes 
  4. * directory /woocommerce/print-order to customize it. 
  5. * 
  6. * @package WooCommerce Print Invoice & Delivery Note/Templates 
  7. */ 
  8.  
  9. if ( !defined( 'ABSPATH' ) ) exit; 
  10. ?> 
  11.  
  12. <div class="order-branding"> 
  13. <div class="company-logo"> 
  14. <?php if( wcdn_get_company_logo_id() ) : ?><?php wcdn_company_logo(); ?><?php endif; ?> 
  15. </div> 
  16.  
  17. <div class="company-info"> 
  18. <?php if( !wcdn_get_company_logo_id() ) : ?><h1 class="company-name"><?php wcdn_company_name(); ?></h1><?php endif; ?> 
  19. <div class="company-address"><?php wcdn_company_info(); ?></div> 
  20. </div> 
  21.  
  22. <?php do_action( 'wcdn_after_branding', $order ); ?> 
  23. </div><!-- .order-branding --> 
  24.  
  25.  
  26. <div class="order-addresses"> 
  27. <div class="billing-address"> 
  28. <h3><?php _e( 'Billing Address', 'woocommerce-delivery-notes' ); ?></h3> 
  29. <address> 
  30.  
  31. <?php if( !$order->get_formatted_billing_address() ) _e( 'N/A', 'woocommerce' ); else echo apply_filters( 'wcdn_address_invoice', $order->get_formatted_billing_address(), $order ); ?> 
  32.  
  33. </address> 
  34. </div> 
  35.  
  36. <?php if( get_option( 'woocommerce_ship_to_billing_address_only' ) === 'no' && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) : ?> 
  37.  
  38. <div class="shipping-address"> 
  39. <h3><?php _e( 'Shipping Address', 'woocommerce-delivery-notes' ); ?></h3> 
  40. <address> 
  41.  
  42. <?php if( !$order->get_formatted_shipping_address() ) _e( 'N/A', 'woocommerce' ); else echo apply_filters( 'wcdn_address_invoice', $order->get_formatted_shipping_address(), $order ); ?> 
  43.  
  44. </address> 
  45. </div> 
  46.  
  47. <?php endif; ?> 
  48.  
  49. <?php do_action( 'wcdn_after_addresses', $order ); ?> 
  50. </div><!-- .order-addresses --> 
  51.  
  52.  
  53. <div class="order-info"> 
  54. <h2><?php wcdn_document_title(); ?></h2> 
  55.  
  56. <ul class="info-list"> 
  57. <?php $fields = apply_filters( 'wcdn_order_info_fields', wcdn_get_order_info( $order ), $order ); ?> 
  58. <?php foreach( $fields as $field ) : ?> 
  59. <li> 
  60. <strong><?php echo apply_filters( 'wcdn_order_info_name', $field['label'], $field ); ?></strong> 
  61. <span><?php echo apply_filters( 'wcdn_order_info_content', $field['value'], $field ); ?></span> 
  62. </li> 
  63. <?php endforeach; ?> 
  64. </ul> 
  65.  
  66. <?php do_action( 'wcdn_after_info', $order ); ?> 
  67. </div><!-- .order-info --> 
  68.  
  69.  
  70. <div class="order-items"> 
  71. <table> 
  72. <thead> 
  73. <tr> 
  74. <th class="head-name"><span><?php _e('Product', 'woocommerce-delivery-notes'); ?></span></th> 
  75. <th class="head-quantity"><span><?php _e('Quantity', 'woocommerce-delivery-notes'); ?></span></th> 
  76. <th class="head-price"><span><?php _e('Total', 'woocommerce-delivery-notes'); ?></span></th> 
  77. </tr> 
  78. </thead> 
  79.  
  80. <tbody> 
  81. <?php if( sizeof( $order->get_items() ) > 0 ) : ?> 
  82. <?php foreach( $order->get_items() as $item ) : ?> 
  83.  
  84. <?php 
  85. $product = apply_filters( 'wcdn_order_item_product', $order->get_product_from_item( $item ), $item ); 
  86. $item_meta = new WC_Order_Item_Meta( $item['item_meta'], $product ); 
  87. ?> 
  88.  
  89. <tr> 
  90. <td class="product-name"> 
  91. <?php do_action( 'wcdn_order_item_before', $product, $order ); ?> 
  92.  
  93. <span class="name"><?php echo apply_filters( 'wcdn_order_item_name', $item['name'], $item ); ?></span> 
  94.  
  95. <?php $item_meta->display(); ?> 
  96.  
  97. <dl class="extras"> 
  98. <?php if( $product && $product->exists() && $product->is_downloadable() && $order->is_download_permitted() ) : ?> 
  99.  
  100. <dt><?php _e( 'Download:', 'woocommerce-delivery-notes' ); ?></dt> 
  101. <dd><?php printf( __( '%s Files', 'woocommerce-delivery-notes' ), count( $order->get_item_downloads( $item ) ) ); ?></dd> 
  102.  
  103. <?php endif; ?> 
  104.  
  105. <?php  
  106. $fields = apply_filters( 'wcdn_order_item_fields', array(), $product, $order );  
  107. foreach ( $fields as $field ) :  
  108. ?> 
  109.  
  110. <dt><?php echo $field['label']; ?></dt> 
  111. <dd><?php echo $field['value']; ?></dd> 
  112.  
  113. <?php endforeach; ?> 
  114. </dl> 
  115. </td> 
  116. <td class="product-quantity"> 
  117. <span><?php echo apply_filters( 'wcdn_order_item_quantity', $item['qty'], $item ); ?></span> 
  118. </td> 
  119. <td class="product-price"> 
  120. <span><?php echo $order->get_formatted_line_subtotal( $item ); ?></span> 
  121. </td> 
  122. </tr> 
  123. <?php endforeach; ?> 
  124. <?php endif; ?> 
  125. </tbody> 
  126.  
  127. <tfoot> 
  128. <?php if( $totals = $order->get_order_item_totals() ) : ?> 
  129. <?php foreach ( $totals as $total ) : ?> 
  130.  
  131. <tr> 
  132. <td class="total-name"><?php echo $total['label']; ?></td> 
  133. <td class="total-quantity"></td> 
  134. <td class="total-price"><?php echo $total['value']; ?></td> 
  135. </tr> 
  136.  
  137. <?php endforeach; ?> 
  138. <?php endif; ?> 
  139. </tfoot> 
  140. </table> 
  141.  
  142. <?php do_action( 'wcdn_after_items', $order ); ?> 
  143. </div><!-- .order-items --> 
  144.  
  145.  
  146. <div class="order-notes"> 
  147. <?php if( wcdn_has_customer_notes( $order ) ) : ?> 
  148. <h4><?php _e( 'Customer Note', 'woocommerce-delivery-notes' ); ?></h4> 
  149. <?php wcdn_customer_notes( $order ); ?> 
  150. <?php endif; ?> 
  151.  
  152. <?php do_action( 'wcdn_after_notes', $order ); ?> 
  153. </div><!-- .order-notes --> 
  154.  
  155.  
  156. <div class="order-thanks"> 
  157. <?php wcdn_personal_notes(); ?> 
  158.  
  159. <?php do_action( 'wcdn_after_thanks', $order ); ?> 
  160. </div><!-- .order-thanks --> 
  161.  
  162.  
  163. <div class="order-colophon"> 
  164. <div class="colophon-policies"> 
  165. <?php wcdn_policies_conditions(); ?> 
  166. </div> 
  167.  
  168. <div class="colophon-imprint"> 
  169. <?php wcdn_imprint(); ?> 
  170. </div>  
  171.  
  172. <?php do_action( 'wcdn_after_colophon', $order ); ?> 
  173. </div><!-- .order-colophon --> 
.