Merge pull request #26567 from woocommerce/fix/26510-created-date
Allow set "date_created" while creating orders via CRUD
This commit is contained in:
commit
cac529c393
|
@ -57,8 +57,10 @@ abstract class Abstract_WC_Order_Data_Store_CPT extends WC_Data_Store_WP impleme
|
||||||
*/
|
*/
|
||||||
public function create( &$order ) {
|
public function create( &$order ) {
|
||||||
$order->set_version( Constants::get_constant( 'WC_VERSION' ) );
|
$order->set_version( Constants::get_constant( 'WC_VERSION' ) );
|
||||||
$order->set_date_created( time() );
|
|
||||||
$order->set_currency( $order->get_currency() ? $order->get_currency() : get_woocommerce_currency() );
|
$order->set_currency( $order->get_currency() ? $order->get_currency() : get_woocommerce_currency() );
|
||||||
|
if ( ! $order->get_date_created( 'edit' ) ) {
|
||||||
|
$order->set_date_created( time() );
|
||||||
|
}
|
||||||
|
|
||||||
$id = wp_insert_post(
|
$id = wp_insert_post(
|
||||||
apply_filters(
|
apply_filters(
|
||||||
|
|
Loading…
Reference in New Issue