Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_filter( 'woocommerce_gzdp_shortcode_invoice_data', 'my_child_invoice_due_date', 10, 3 );
- // Add [invoice_data meta="due_date"] as shortcode to your invoice settings
- function my_child_invoice_due_date( $return, $atts, $invoice ) {
- if ( 'due_date' === $atts['meta'] ) {
- // Calculate date
- $date = new DateTime();
- $date->setTimestamp( strtotime( $invoice->post->post_date ) );
- $date->modify( '+2 weeks' );
- $return = 'Rechnung ist zu zahlen bis zum ' . $date->format( get_option( 'woocommerce_gzdp_invoice_date_format' ) );
- }
- return $return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement