{"id":6129549,"date":"2015-05-14T10:38:07","date_gmt":"2015-05-14T10:38:07","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/pdf-invoice-displays-custom-data-from-eventon-plugin\/"},"modified":"2016-08-24T16:14:36","modified_gmt":"2016-08-24T16:14:36","slug":"pdf-invoice-displays-custom-data-from-eventon-plugin","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/pdf-invoice-displays-custom-data-from-eventon-plugin\/","title":{"rendered":"PDF Invoice displays Custom Data from EventOn Plugin"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I&#8217;m trying to use the WooCommerce PDF Invoices &amp; Packing Slips plugin. But in the Invoice template I like to use data from the EventOn plugin. <\/p>\n<p>the EventOn Plugin is giving tickets and I want these tickets being displayed in the INVOICE. At the moment, it only displays the WooCommerce order. <\/p>\n<p>Any suggestion how to make this possible?<br \/>\nI have read <a href=\"https:\/\/wordpress.org\/plugins\/woocommerce-pdf-invoices-packing-slips\/faq\/\">your Faq<\/a> in how to display custom fields in the invoice or packing slip, but cant get further.<\/p>\n<p>Below some code from the Event On Plugin. From Line 107 is the code i&#8217;d like to be having displayed on the PDF.<\/p>\n<pre><code>&lt;?php\n\/**\n * Ticket Confirmation email Template\n * @version 2.0\n *\n * To customize: copy this file to your theme folder as below path\n * path: your-theme-dir\/eventon\/templates\/email\/tickets\/\n *\/\n\n\tglobal $eventon, $evotx;\n\n\t\/\/ $args are passed to this page\n\t\/\/ These are required on this template page to get correct ticket values\n\n\t\t$email = $args[1];\n\t\t$args = $args[0];\n\t\t$evo_options = get_option(&#039;evcal_options_evcal_1&#039;);\n\t\t$evo_options_2 = get_option(&#039;evcal_options_evcal_2&#039;);\n\n\t\t$tix__ = new evotx_ticket();\n\n\t\/\/ inline styles\n\t\t$__styles_01 = &quot;font-size:30px; color:#303030; font-weight:bold; text-transform:uppercase; margin-bottom:0px;  margin-top:0;&quot;;\n\t\t$__styles_02 = &quot;font-size:18px; color:#303030; font-weight:normal; text-transform:uppercase; display:block; font-style:italic; margin: 4px 0; line-height:110%&quot;;\n\t\t$__sty_lh = &quot;line-height:110%;&quot;;\n\t\t$__styles_02a = &quot;color:#afafaf; text-transform:none&quot;;\n\t\t$__styles_03 = &quot;color:#afafaf; font-style:italic;font-size:13px; margin:0 0 10px 0&quot;;\n\t\t$__styles_03a = &quot;color:#afafaf; font-style:none;font-size:13px; margin:0 0 00px 0&quot;;\n\t\t$__styles_04 = &quot;color:#303030; text-transform:uppercase; font-size:18px; font-style:italic; padding-bottom:0px; margin-bottom:0px; line-height:110%;&quot;;\n\t\t$__styles_05 = &quot;padding-bottom:40px; &quot;;\n\t\t$__styles_06 = &quot;border-bottom:1px dashed #d1d1d1; padding:5px 20px&quot;;\n\t\t$__sty_td =&quot;padding:0px;border:none&quot;;\n\t\t$__sty_pt20 =&quot;padding-top:20px;&quot;;\n\t\t$__sty_m0 =&quot;margin:0px;&quot;;\n\n\t\t$__styles_button = &quot;font-size:14px; background-color:#&quot;.( !empty($evo_options[&#039;evcal_gen_btn_bgc&#039;])? $evo_options[&#039;evcal_gen_btn_bgc&#039;]: &quot;237ebd&quot;).&quot;; color:#&quot;.( !empty($evo_options[&#039;evcal_gen_btn_fc&#039;])? $evo_options[&#039;evcal_gen_btn_fc&#039;]: &quot;ffffff&quot;).&quot;; padding: 5px 10px; text-decoration:none; border-radius:4px;&quot;;\n\n?&gt;\n\n&lt;table width=&#039;100%&#039; style=&#039;width:100%; margin:0&#039;&gt;\n&lt;?php\n$count = 1;\n\nif(empty($args[&#039;tickets&#039;])) return;\n\n\/\/ order items as ticket items - run through each\nforeach($args[&#039;tickets&#039;] as $ticket_item):\n\n\t\/\/ initiate ticket order item class\n\t\t$torderItem = new evotx_ticket_orderitem($ticket_item, $args[&#039;orderid&#039;]);\n\n\t\t$event_id = $torderItem-&gt;event_id();\n\t\t$e_pmv = get_post_custom($event_id);\n\n\t\/\/ ticket item ID\n\t\t$ticket_item_id = $torderItem-&gt;the_ticket_item_id;\n\n\t\/\/ location data\n\t\t$location = (!empty($e_pmv[&#039;evcal_location_name&#039;])? $e_pmv[&#039;evcal_location_name&#039;][0].&#039; &#039;: null).(!empty($e_pmv[&#039;evcal_location&#039;])? $e_pmv[&#039;evcal_location&#039;][0]:null);\n\n\t\/\/ event time\n\t\t$ticketItem = new evotx_TicketItem($ticket_item_id);\n\t\t$__date = $ticketItem-&gt;_event_date($event_id , $e_pmv);\n\t\t$time = $ticketItem-&gt;get_correct_times($event_id , $e_pmv);\n\t\t$event_time = $ticketItem-&gt;get_event_time($event_id, $time[&#039;start&#039;],$time[&#039;end&#039;]);\n\n?&gt;\n\t&lt;tr&gt;\n\t\t&lt;td style=&#039;&lt;?php echo $__sty_td;?&gt;&#039;&gt;\n\n\t\t\t&lt;div class=&#039;event_date&#039; style=&#039;&lt;?php echo $__styles_06;?&gt;&#039;&gt;\n\t\t\t\t&lt;p style=&#039;padding-top:10px;color:#555555; text-transform:uppercase; font-size:12px; margin:0px; line-height:100%&#039;&gt;&lt;?php echo date(&#039;D&#039;,$time[&#039;start&#039;]) ;?&gt;&lt;\/p&gt;\n\t\t\t\t&lt;p style=&#039;margin:0px; text-transform:uppercase; font-size:20px;&lt;?php echo $__sty_lh;?&gt;&#039;&gt;&lt;?php echo $__date[&#039;html_date&#039;];?&gt;&lt;\/p&gt;\n\t\t\t\t&lt;p style=&#039;margin:0px; padding-bottom:10px; font-style:italic; color:#838383;&lt;?php echo $__sty_lh;?&gt;&#039;&gt;&lt;?php echo $__date[&#039;html_fromto&#039;];?&gt;&lt;\/p&gt;\n\t\t\t&lt;\/div&gt;\n\t\t\t&lt;div style=&quot;padding:20px; font-family:&#039;open sans&#039;&quot;&gt;\n\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_01.$__sty_lh;?&gt;&#039;&gt;&lt;?php echo $ticket_item[&#039;name&#039;];?&gt;&lt;\/p&gt;\n\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_02;?&gt;&#039;&gt;&lt;span style=&#039;&lt;?php echo $__styles_02a;?&gt;&#039;&gt;&lt;?php echo eventon_get_custom_language( $evo_options_2,&#039;evoTX_004&#039;, &#039;Primary ticket holder&#039;);?&gt;:&lt;\/span&gt; &lt;?php echo $args[&#039;customer&#039;];?&gt;&lt;\/p&gt;\n\t\t\t\t&lt;!-- quantity--&gt;\n\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_02;?&gt;&#039;&gt;&lt;span style=&#039;&lt;?php echo $__styles_02a;?&gt;&#039;&gt;&lt;?php echo eventon_get_custom_language( $evo_options_2,&#039;evoTX_005&#039;, &#039;Quantity&#039;);?&gt;:&lt;\/span&gt; &lt;?php echo $ticket_item[&#039;qty&#039;];?&gt;&lt;\/p&gt;\n\t\t\t\t&lt;!-- Event Time--&gt;\n\t\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_04.$__sty_pt20;?&gt;&#039;&gt;&lt;?php echo eventon_get_custom_language( $evo_options_2,&#039;evoTX_005a&#039;, &#039;Event Time&#039;);?&gt;&lt;\/p&gt;\n\t\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_03;?&gt;&#039;&gt;&lt;?php echo $event_time;?&gt;&lt;\/p&gt;\n\n\t\t\t\t&lt;?php if(!empty($ticket_item[&#039;variation_id&#039;])):\n\t\t\t\t\t$_product = new WC_Product_Variation($ticket_item[&#039;variation_id&#039;] );\n        \t\t\t$hh= $_product-&gt;get_variation_attributes( );\n\n        \t\t\t\tforeach($hh as $f=&gt;$v):\n        \t\t\t\t\tif(empty($v)) continue;\n\t\t\t\t\t?&gt;\n\t\t\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_03;?&gt;&#039;&gt;&lt;span style=&#039;&lt;?php echo $__styles_02a;?&gt;&#039;&gt;&lt;?php echo eventon_get_custom_language( $evo_options_2,&#039;evoTX_006&#039;, &#039;Type&#039;);?&gt;:&lt;\/span&gt; &lt;?php echo $v;?&gt;&lt;\/p&gt;\n\t\t\t\t\t&lt;?php endforeach; endif;?&gt;\n\n\t\t\t\t&lt;!-- location --&gt;\n\t\t\t\t\t&lt;?php if(!empty($location)):?&gt;\n\t\t\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_04;?&gt;&#039;&gt;Location&lt;\/p&gt;\n\t\t\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_03;?&gt;&#039;&gt;&lt;?php echo $location;?&gt;&lt;\/p&gt;\n\t\t\t\t\t&lt;?php endif;?&gt;\n\n\t\t\t\t&lt;!-- add to calendar --&gt;\n\t\t\t\t&lt;p style=&#039;margin:0px; &lt;?php echo (empty($location))? $__sty_pt20:null;?&gt;&lt;?php echo (count($args[&#039;tickets&#039;])&gt;1)? &quot;margin-bottom:30px&quot;:null;?&gt;&#039;&gt;&lt;a style=&#039;&lt;?php echo $__styles_button;?&gt;&#039; href=&#039;&lt;?php echo admin_url();?&gt;admin-ajax.php?action=eventon_ics_download&amp;event_id=&lt;?php echo $event_id;?&gt;&amp;sunix=&lt;?php echo $e_pmv[&#039;evcal_srow&#039;][0];?&gt;&amp;eunix=&lt;?php echo $e_pmv[&#039;evcal_erow&#039;][0];?&gt;&#039; target=&#039;_blank&#039;&gt;&lt;?php echo eventon_get_custom_language( $evo_options_2,&#039;evcal_evcard_addics&#039;, &#039;Add to calendar&#039;);?&gt;&lt;\/a&gt;&lt;\/p&gt;\n\n\t\t\t\t&lt;?php do_action(&#039;evotx_ticket_template_end&#039;, $event_id, $ticket_item);?&gt;\n\t\t\t&lt;\/div&gt;\n\t\t\t&lt;div style=&#039;width:48%;&#039;&gt;\n\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_02;?&gt;; padding-left:20px&#039;&gt;&lt;span style=&#039;&lt;?php echo $__styles_02a;?&gt;&#039;&gt;&lt;?php echo eventon_get_custom_language( $evo_options_2,&#039;evoTX_003&#039;, &#039;Ticket(s) #&#039;);?&gt;&lt;\/span&gt;&lt;\/p&gt;\n\t\t\t\t&lt;?php \n\n\t\t\t\t\t$ticketids = $torderItem-&gt;ticket_ids();\n\t\t\t\t\tif(is_array($ticketids)):\n\t\t\t\t?&gt;\n\t\t\t\t&lt;?php foreach($ticketids as $ff=&gt;$vv):?&gt;\n\t\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_02;?&gt;; border-top:1px dashed #d1d1d1; padding:8px 20px 5px;&#039;&gt;&lt;?php echo apply_filters(&#039;evotx_email_tixid_list&#039;, $ff);?&gt; &lt;\/p&gt;&lt;\/br&gt;\n\t\t\t\t\t&lt;!-- MNO CUSTOM add time--&gt;\n\t\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_03a.$__sty_pt14;?&gt;; padding:0px 20px 5px;&#039;&gt;&lt;?php echo eventon_get_custom_language( $evo_options_2,&#039;evoTX_005a&#039;, &#039;Starting Time: &#039;);?&gt;&lt;br \/&gt;&lt;?php echo $event_time;?&gt;\n\t\t\t\t\t&lt;!-- MNO CUSTOM location --&gt;\n\t\t\t\t\t&lt;?php if(!empty($location)):?&gt;\n\t\t\t\t\t\t&lt;p style=&#039;&lt;?php echo $__styles_03a;?&gt;; padding:0px 20px 5px;&#039;&gt;Location: &lt;br \/&gt;&lt;?php echo $location;?&gt;&lt;\/p&gt;\n\t\t\t\t\t&lt;?php endif;?&gt;\n\t\t\t\t&lt;?php endforeach;\n\n\t\t\t\t\telse:\n\t\t\t\t\t\t?&gt; &lt;p style=&#039;&lt;?php echo $__styles_02;?&gt;; border-top:1px dashed #d1d1d1; padding:8px 20px 5px;&#039;&gt;&lt;?php echo apply_filters(&#039;evotx_email_tixid_list&#039;, $ticketids);?&gt;&lt;\/p&gt;&lt;?php\n\t\t\t\t\tendif;\n\t\t\t\t?&gt;\n\n\t\t\t&lt;\/div&gt;\n\t\t&lt;\/td&gt;\n\t&lt;\/tr&gt;\n&lt;?php endforeach;?&gt;\n&lt;?php if($email):?&gt;\n\t&lt;tr&gt;\n\t\t&lt;td  style=&#039;padding:20px; text-align:left;border-top:1px dashed #d1d1d1; font-style:italic; color:#ADADAD&#039;&gt;\n\t\t\t&lt;?php\n\t\t\t\t$__link = (!empty($evo_options[&#039;evors_contact_link&#039;]))? $evo_options[&#039;evors_contact_link&#039;]:site_url();\n\t\t\t?&gt;\n\t\t\t&lt;p style=&#039;&lt;?php echo $__sty_lh.$__sty_m0;?&gt;&#039;&gt;&lt;?php echo eventon_get_custom_language( $evo_options_2,&#039;evoTX_007&#039;, &#039;We look forward to seeing you!&#039;)?&gt;&lt;\/p&gt;\n\t\t\t&lt;p style=&#039;&lt;?php echo $__sty_lh.$__sty_m0;?&gt;&#039;&gt;&lt;a style=&#039;&#039; href=&#039;&lt;?php echo $__link;?&gt;&#039;&gt;&lt;?php echo eventon_get_custom_language( $evo_options_2,&#039;evoTX_008&#039;, &#039;Contact Us for questions and concerns&#039;)?&gt;&lt;\/a&gt;&lt;\/p&gt;\n\t\t&lt;\/td&gt;\n\t&lt;\/tr&gt;\n&lt;?php endif;?&gt;\n&lt;\/table&gt;\n\n&lt;?php\n\n?&gt;<\/code><\/pre>\n<p>Thank you for your help!<\/p>\n<p><a href=\"http:\/\/www.myeventon.com\/\">http:\/\/www.myeventon.com\/<\/a><br \/>\n<a href=\"https:\/\/wordpress.org\/plugins\/woocommerce-pdf-invoices-packing-slips\">https:\/\/wordpress.org\/plugins\/woocommerce-pdf-invoices-packing-slips<\/a><\/p>\n","protected":false},"template":"","class_list":["post-6129549","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6129549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6129549\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6129549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}