File "class-wc-order-tracking.php"

Full path: /home/kosmetik/public_html/wp-content/plugins/woocommerce/includes/tracks/events/class-wc-order-tracking.php
File size: 654 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php

defined('ABSPATH') || exit;
class WC_Order_Tracking
{
    public function init()
    {
        add_action('woocommerce_admin_order_data_after_order_details', array($this, 'track_order_viewed'));
    }
    public function track_order_viewed($order)
    {
        if (!$order instanceof WC_Order || !$order->get_id()) {
            return;
        }
        $properties = array('current_status' => $order->get_status(), 'date_created' => $order->get_date_created() ? $order->get_date_created()->format(DateTime::ATOM) : '', 'payment_method' => $order->get_payment_method());
        WC_Tracks::record_event('single_order_view', $properties);
    }
}