Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. add_filter( 'woocommerce_gzdp_shortcode_invoice_data', 'my_child_invoice_due_date', 10, 3 );
  4.  
  5. // Add [invoice_data meta="due_date"] as shortcode to your invoice settings
  6. function my_child_invoice_due_date( $return, $atts, $invoice ) {
  7. if ( 'due_date' === $atts['meta'] ) {
  8. // Calculate date
  9. $date = new DateTime();
  10. $date->setTimestamp( strtotime( $invoice->post->post_date ) );
  11. $date->modify( '+2 weeks' );
  12.  
  13. $return = 'Rechnung ist zu zahlen bis zum ' . $date->format( get_option( 'woocommerce_gzdp_invoice_date_format' ) );
  14. }
  15.  
  16. return $return;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement