Forcing today’s date
-
Hi,
I’m using a plugin which is currently getting the order date from woocommerce however, I need this to use today’s date rather than getting it from the order date.
See a few bits of code that I feel may be responsible/need changing.
If anyone could help out here it would be really appreciated.
`
/**
* @var string
*/
private $date = ”;/**
* Construct
*
* @param WC_XR_Settings $settings
* @param WC_XR_Contact $contact
* @param string $datepublic function __construct( $settings, $contact, $date, $due_date, $invoice_number, $line_items, $currency_code, $total_tax, $total ) {
$this->settings = $settings;
$this->contact = $contact;
$this->date = $date;/**
* @return string
*/
public function get_date() {
return apply_filters( ‘woocommerce_xero_invoice_date’, $this->date, $this );
}/**
* @param string $date
*/
public function set_date( $date ) {
$this->date = $date;
}*/
public function get_invoice_by_order( $order ) {$old_wc = version_compare( WC_VERSION, ‘3.0’, ‘<‘ );
$order_date = $old_wc ? $order->order_date : $order->get_date_created()->date( ‘Y-m-d H:i:s’ );
$date_parts = explode( ‘ ‘, $order_date );
$order_ymd = $date_parts[0];
- The topic ‘Forcing today’s date’ is closed to new replies.