Skip to content

Commit

Permalink
Fix: modifying order creation date in the 'get_due_date' method (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadNateqi authored Nov 27, 2023
1 parent 563879e commit ad21a6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/documents/abstract-wcpdf-order-document.php
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,8 @@ public function get_due_date(): int {
}

$base_date = apply_filters( 'wpo_wcpdf_due_date_base_date', $this->order->get_date_created(), $this->type, $this );
$due_date_datetime = $base_date->modify( "+$due_date_days days" );
$due_date_datetime = clone $base_date;
$due_date_datetime = $due_date_datetime->modify( "+$due_date_days days" );

return apply_filters( 'wpo_wcpdf_due_date', $due_date_datetime->getTimestamp() ?? 0, $this->type, $this );
}
Expand Down

0 comments on commit ad21a6a

Please sign in to comment.