Added Gift Message to PDF invoice printouts
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 16 Jun 2017 19:52:09 +0000 (15:52 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Fri, 16 Jun 2017 19:52:09 +0000 (15:52 -0400)
functions.php
style.css

index c3177b9..2392978 100755 (executable)
@@ -196,6 +196,19 @@ function tm_added_checkout_fields_email( $keys ) {
         return $keys;
 }
 
+// Add Gift Message to PDF Invoice printout
+add_action( 'wpo_wcpdf_after_order_details', 'woocommerce_invoice_gift_message', 10, 2 );
+function woocommerce_invoice_gift_message ($template_type, $order) {
+    global $wpo_wcpdf;
+    if ($template_type == 'invoice') {
+        ?>
+        <div class="custom-text">
+            <?php $wpo_wcpdf->custom_field('Gift Message', "Gift Message:<br>"); ?>
+        </div>
+        <?php
+    }
+}
+
 // Add custom fields to order printouts
 function add_custom_fields_to_order_printout( $fields, $order ) {
     $new_fields = array();
index b4a05a6..89eea28 100755 (executable)
--- a/style.css
+++ b/style.css
@@ -3,5 +3,5 @@ Theme Name: Tom's Mom's Cookies
 Author: Gaslight Media
 Author URI: http://www.gaslightmedia.com
 Description: A theme made for Tom's Mom's Cookies.
-Version: 1.0.19
+Version: 1.0.20
 */