Automattic\WooCommerce\Admin\API\Reports\Orders\Stats
DataStore::sync_order()
Add order information to the lookup table when orders are created or modified.
{} Это метод класса: DataStore{}
Хуков нет.
Возвращает
int|true|false
. Returns -1 if order won't be processed, or a boolean indicating processing success.
Использование
$result = DataStore::sync_order( $post_id );
- $post_id(int) (обязательный)
- Post ID.
Код DataStore::sync_order() DataStore::sync order WC 6.6.1
public static function sync_order( $post_id ) { if ( 'shop_order' !== get_post_type( $post_id ) && 'shop_order_refund' !== get_post_type( $post_id ) ) { return -1; } $order = wc_get_order( $post_id ); if ( ! $order ) { return -1; } return self::update( $order ); }