Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter seemorematt

    (@seemorematt)

    I did also notice that I had an incorrect PHP closing tag in the first code. It still didn’t work with that code, however, it did work when using it as a variable.

    add_action( 'wpo_wcpdf_after_order_data', 'woops_sage_customer_number', 10, 2 );
    function woops_sage_customer_number ($template_type, $order) {
        if ($template_type == 'packing-slip') {
    
    	     $customerid = $order->get_user_id();
    
    	     $customerno = get_field('customer_number', 'user_'. $customerid );
    	     if ($customerno) {
    	      ?>
    
    		    <tr class="customer-number">
    		        <th>Customer Number:</th>
    		        <td><?php echo $customerno; ?></td>
    		    </tr>
    		    <?php
    		}
    	}
    }'

    Thank you for your help and swift reply!

    • This reply was modified 5 years, 7 months ago by seemorematt.
Viewing 1 replies (of 1 total)