Esempio n. 1
0
function fn_google_analytics_change_order_status($status_to, $status_from, $order_info)
{
    if (Registry::get('addons.google_analytics.track_ecommerce') == 'N') {
        return false;
    }
    $order_statuses = fn_get_statuses(STATUSES_ORDER, false, true, true);
    if ($order_statuses[$status_to]['inventory'] == 'D' && $order_statuses[$status_from]['inventory'] == 'I') {
        // decrease amount
        fn_google_anaylitics_send(Registry::get('addons.google_analytics.tracking_code'), $order_info, false);
    } elseif ($order_statuses[$status_to]['inventory'] == 'I' && $order_statuses[$status_from]['inventory'] == 'D') {
        // increase amount
        fn_google_anaylitics_send(Registry::get('addons.google_analytics.tracking_code'), $order_info, true);
    }
}
Esempio n. 2
0
function fn_google_analytics_change_order_status(&$status_to, &$status_from, &$order_info)
{
    if (Registry::get('addons.google_analytics.track_ecommerce') == 'N' || AREA != 'A') {
        return false;
    }
    $order_statuses = fn_get_statuses(STATUSES_ORDER, array(), true, true);
    if ($order_statuses[$status_to]['params']['inventory'] == 'D' && $order_statuses[$status_from]['params']['inventory'] == 'I') {
        // decrease amount
        fn_google_anaylitics_send(fn_google_analytics_get_tracking_code($order_info['company_id']), $order_info, false);
    } elseif ($order_statuses[$status_to]['params']['inventory'] == 'I' && $order_statuses[$status_from]['params']['inventory'] == 'D') {
        // increase amount
        fn_google_anaylitics_send(fn_google_analytics_get_tracking_code($order_info['company_id']), $order_info, true);
    }
}