Advertisement
eappereira

Display Field Custom Admin and Customer Panel

Feb 5th, 2015
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.36 KB | None | 0 0
  1. function display_order_field_delivery_customer( $order_id ){  ?>
  2.     <h2><?php _e( 'Detalhes da entrega' ); ?></h2>
  3.     <table class="shop_table shop_table_responsive additional_info">
  4.         <tbody>
  5.             <tr>
  6.                 <th><?php _e( 'Entrega:' ); ?></th>
  7.                 <td><?php echo get_post_meta( $order_id, '_billing_delivery', true ); ?></td>
  8.             </tr>
  9.             <tr>
  10.                 <th><?php _e( 'Entrega:' ); ?></th>
  11.                 <td><?php echo get_post_meta( $order_id, '_billing_delivery', true ); ?></td>
  12.             </tr>
  13.         </tbody>
  14.     </table>
  15. <?php }
  16. add_action( 'woocommerce_thankyou', 'delivery_display_order_data', 20 );
  17. add_action( 'woocommerce_view_order', 'delivery_display_order_data', 20 );
  18.  
  19.  
  20. // display the extra data in the order admin panel
  21. function delivery_display_order_data_admin( $order ){  ?>
  22.     <div class="order_data_column">
  23.         <h4><?php _e( 'Data de Entrega', 'woocommerce' ); ?></h4>
  24.         <?php
  25.             echo '<p><strong>' . __( 'Entrega' ) . ':</strong>' . get_post_meta( $order->id, '_billing_delivery', true ) . '</p>';
  26.             echo '<p><strong>' . __( 'Entrega' ) . ':</strong>' . get_post_meta( $order->id, '_billing_delivery', true ) . '</p>'; ?>
  27.     </div>
  28. <?php }
  29. add_action( 'woocommerce_admin_order_data_after_order_details', 'delivery_display_order_data_admin' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement