Title: Meta_key Array value
Last modified: April 2, 2024

---

# Meta_key Array value

 *  Resolved [devworlds](https://wordpress.org/support/users/devworlds/)
 * (@devworlds)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/meta_key-array-value/)
 * Hi,
 * I want to show one order meta array name.
 * order meta key name is– **payment_data**
 * payment_data array like this– a:18:{s:10:”product_id”;i:1467;s:11:”product_qty”;
   i:1;s:16:”activate_payment”;s:4:”auto”;s:22:”charge_shipping_during”;s:15:”initial-
   payment”;s:12:”down_payment”;d:0;s:10:”base_price”;N;s:17:”next_payment_date”;
   s:19:”2024-05-01 00:00:00″;s:23:”next_installment_amount”;d:75.01500000000001;
   s:20:”total_payable_amount”;d:450.09000000000003;}
 * I want to show **next_payment_date** how can i show it?
 * thank you

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Contributor [dwpriv](https://wordpress.org/support/users/dwpriv/)
 * (@dwpriv)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/meta_key-array-value/#post-17545705)
 * Where are you trying to display the payment data? Can you share your full code
   snippet, please?
 *  Thread Starter [devworlds](https://wordpress.org/support/users/devworlds/)
 * (@devworlds)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/meta_key-array-value/#post-17547391)
 * Hi,
 * I’m trying to display on invoice.
 *     ```wp-block-code
       add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_my_custom_field', 10, 2 );
   
       function wpo_wcpdf_my_custom_field ($document_type, $order) {
   
       if ( $document_type == 'invoice' ) {
   
       ?>
   
       <tr class="due-date">
   
       <th>Due Date:</th>
   
       <td><?php
   
       $payment_data = $order->get_meta('_pp_payment_data', true);
       // Here i want to Show from array filed name next_payment_date 
   
       ?>
   
       </td></tr>
       <?php }}?>
       ```
   
 *  Plugin Contributor [dwpriv](https://wordpress.org/support/users/dwpriv/)
 * (@dwpriv)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/meta_key-array-value/#post-17549077)
 * Thanks for the information
 * Try this snippet
 *     ```wp-block-code
       add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_my_custom_field', 10, 2 );
       function wpo_wcpdf_my_custom_field ($document_type, $order) {
       if ( $document_type == 'invoice' ) {
       	?>
       	<tr class="due-date">
       		<th>Due Date:</th>
       		<td>
       			<?php
       				$payment_data = $order->get_meta('_pp_payment_data', true);
       				if ( ! empty( $payment_data ) ) {
       					foreach( $payment_data as $id => $data ) {
       						if ( $data == 'next_payment_date' ) {
       							echo $data;
       						}
   
       					}
       				}
       			?>
       		</td>
       	</tr>
       <?php }
       }
       ```
   
 *  Thread Starter [devworlds](https://wordpress.org/support/users/devworlds/)
 * (@devworlds)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/meta_key-array-value/#post-17704413)
 * Hi,
 * Sorry for late reply.
 * The code is not working.
 * Can can you please help me to show this date correctly.
 * The plugin deleveloper sayed this– **It stores under post meta_key named “_next_payment_date”
   and “_actual_payments_date”.**
 * thank you
    -  This reply was modified 2 years, 1 month ago by [devworlds](https://wordpress.org/support/users/devworlds/).
 *  Plugin Contributor [dwpriv](https://wordpress.org/support/users/dwpriv/)
 * (@dwpriv)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/meta_key-array-value/#post-17705699)
 * [@devworlds](https://wordpress.org/support/users/devworlds/) try replacing the
   snippet with this one
 *     ```wp-block-code
       add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_my_custom_field', 10, 2 );
       function wpo_wcpdf_my_custom_field ($document_type, $order) {
       if ( $document_type == 'invoice' ) {
       	?>
       	<tr class="due-date">
       		<th>Due Date:</th>
       		<td>
       			<?php
       				$payment_data = $order->get_meta('_pp_payment_data', true);
       				if ( ! empty( $payment_data ) ) {
       					foreach( $payment_data as $id => $data ) {
       						if ( $data == '_next_payment_date' ) {
       							echo $data;
       						}
   
       					}
       				}
       			?>
       		</td>
       	</tr>
       <?php }
       }
       ```
   
 *  Thread Starter [devworlds](https://wordpress.org/support/users/devworlds/)
 * (@devworlds)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/meta_key-array-value/#post-17709583)
 * Hi,
 * Still it coming white.
 * thank you
 *  Plugin Contributor [dwpriv](https://wordpress.org/support/users/dwpriv/)
 * (@dwpriv)
 * [2 years ago](https://wordpress.org/support/topic/meta_key-array-value/#post-17744263)
 * [@devworlds](https://wordpress.org/support/users/devworlds/) my apologies for
   the late response! I thought I had replied to this before.
 * Is the meta data located in the items post data or the order post data? You can
   try this edit
 *     ```wp-block-code
       add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_my_custom_field', 10, 2 );
       function wpo_wcpdf_my_custom_field ($document_type, $order) {
       if ( $document_type == 'invoice' ) {
       	?>
       	<tr class="due-date">
       		<th>Due Date:</th>
       		<td>
       			<?php
       				$payment_data = $order->get_meta('_pp_payment_data', true);
       				if ( ! empty( $payment_data ) && ! empty( $order->get_meta( '_next_payment_date' ) ) ) {
       					echo $order->get_meta( '_next_payment_date' ); 
       				}
       			?>
       		</td>
       	</tr>
       <?php }
       }
       ```
   
 *  Thread Starter [devworlds](https://wordpress.org/support/users/devworlds/)
 * (@devworlds)
 * [2 years ago](https://wordpress.org/support/topic/meta_key-array-value/#post-17746298)
 * Thanks
    -  This reply was modified 2 years ago by [devworlds](https://wordpress.org/support/users/devworlds/).

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Meta_key Array value’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [devworlds](https://wordpress.org/support/users/devworlds/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/meta_key-array-value/#post-17746298)
 * Status: resolved