UA fix, add new filters
This commit is contained in:
parent
cbc6eaef93
commit
9c71bc36a0
@ -1,3 +1,7 @@
|
||||
## 2018-06-19 v3.1.1
|
||||
* Исправлен код отправки данных в UA
|
||||
* Добавлены новые фильтры, добавлена передача новых параметров в существущие
|
||||
|
||||
## 2018-05-28 v3.1.0
|
||||
* В интерфейс настроек плагина добавлена возможность ручной выгрузки заказов
|
||||
* Исправлена инициализация кода UA для отправки заказов на всех страницах
|
||||
|
@ -145,7 +145,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
|
||||
);
|
||||
}
|
||||
|
||||
$this->customer = apply_filters('retailcrm_process_customer', $data_customer);
|
||||
$this->customer = apply_filters('retailcrm_process_customer', $data_customer, $customer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,7 +95,7 @@ if (!class_exists('WC_Retailcrm_Google_Analytics')) {
|
||||
ga('require', 'ecommerce', 'ecommerce.js');
|
||||
ga('ecommerce:addTransaction', {
|
||||
'id':" . $order->get_id() . ",
|
||||
'affiliation':" . $domain . ",
|
||||
'affiliation':'" . $domain . "',
|
||||
'revenue':" . $order->get_total() . ",
|
||||
'shipping':" . $order->get_total_tax() . ",
|
||||
'tax':" . $order->get_shipping_total() . "
|
||||
@ -111,13 +111,12 @@ if (!class_exists('WC_Retailcrm_Google_Analytics')) {
|
||||
'price': " . $item['price'] . ",
|
||||
'quantity': " . $item['quantity'] . "
|
||||
});
|
||||
|
||||
}
|
||||
ga('ecommerce:send');
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
$js .= "ga('ecommerce:send');
|
||||
</script>";
|
||||
|
||||
return apply_filters('retailcrm_send_analytics', $js);
|
||||
}
|
||||
}
|
||||
|
@ -363,7 +363,7 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) :
|
||||
}
|
||||
}
|
||||
|
||||
$this->order = apply_filters('retailcrm_process_order', $order_data);
|
||||
$this->order = apply_filters('retailcrm_process_order', $order_data, $order);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -10,35 +10,37 @@ function get_wc_shipping_methods($enhanced = false) {
|
||||
$shippingZonesObj = new WC_Shipping_Zones();
|
||||
$shippingZones = $shippingZonesObj->get_zones();
|
||||
|
||||
foreach ($shippingZones as $code => $shippingZone) {
|
||||
foreach ($shippingZone['shipping_methods'] as $key => $shipping_method) {
|
||||
$shipping_methods = array(
|
||||
'id' => $shipping_method->id,
|
||||
'instance_id' => $shipping_method->instance_id,
|
||||
'title' => $shipping_method->title
|
||||
);
|
||||
|
||||
if ($enhanced) {
|
||||
$shipping_code = $shipping_method->id;
|
||||
} else {
|
||||
$shipping_code = $shipping_method->id . ':' . $shipping_method->instance_id;
|
||||
}
|
||||
|
||||
if (!isset($result[$shipping_code])) {
|
||||
$result[$shipping_code] = array(
|
||||
'name' => $shipping_method->method_title,
|
||||
'enabled' => $shipping_method->enabled,
|
||||
'description' => $shipping_method->method_description,
|
||||
if ($shippingZones) {
|
||||
foreach ($shippingZones as $code => $shippingZone) {
|
||||
foreach ($shippingZone['shipping_methods'] as $key => $shipping_method) {
|
||||
$shipping_methods = array(
|
||||
'id' => $shipping_method->id,
|
||||
'instance_id' => $shipping_method->instance_id,
|
||||
'title' => $shipping_method->title
|
||||
);
|
||||
}
|
||||
|
||||
if ($enhanced) {
|
||||
$result[$shipping_method->id]['shipping_methods'][$shipping_method->id . ':' . $shipping_method->instance_id] = $shipping_methods;
|
||||
unset($shipping_methods);
|
||||
if ($enhanced) {
|
||||
$shipping_code = $shipping_method->id;
|
||||
} else {
|
||||
$shipping_code = $shipping_method->id . ':' . $shipping_method->instance_id;
|
||||
}
|
||||
|
||||
if (!isset($result[$shipping_code])) {
|
||||
$result[$shipping_code] = array(
|
||||
'name' => $shipping_method->method_title,
|
||||
'enabled' => $shipping_method->enabled,
|
||||
'description' => $shipping_method->method_description,
|
||||
'title' => $shipping_method->title
|
||||
);
|
||||
}
|
||||
|
||||
if ($enhanced) {
|
||||
$result[$shipping_method->id]['shipping_methods'][$shipping_method->id . ':' . $shipping_method->instance_id] = $shipping_methods;
|
||||
unset($shipping_methods);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
return apply_filters('retailcrm_shipping_list', $result);
|
||||
}
|
||||
|
@ -45,6 +45,10 @@ API-ключ должен быть для отдельного магазина
|
||||
2. В появившихся списках справочников настройте соответствие способов доставки и оплаты, а так же статусов заказов. Отметьте галочку "Выгружать остатки", если хотите выгружать остатки из Retailcrm в магазин (подробнее смотрите в описании).
|
||||
|
||||
== Changelog ==
|
||||
= 3.1.1 =
|
||||
* Исправлен код отправки данных в UA
|
||||
* Добавлены новые фильтры, добавлена передача новых параметров в существущие
|
||||
|
||||
= 3.1.0 =
|
||||
* В интерфейс настроек плагина добавлена возможность ручной выгрузки заказов
|
||||
* Исправлена инициализация кода UA для отправки заказов на всех страницах
|
||||
@ -123,6 +127,10 @@ API-ключ должен быть для отдельного магазина
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= 3.1.1 =
|
||||
Исправлен код отправки данных в UA
|
||||
Добавлены новые фильтры, добавлена передача новых параметров в существущие
|
||||
|
||||
= 3.1.0 =
|
||||
В интерфейс настроек плагина добавлена возможность ручной выгрузки заказов
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Version: 3.1.0
|
||||
* Version: 3.1.1
|
||||
* WC requires at least: 3.0
|
||||
* WC tested up to: 3.3
|
||||
* Plugin Name: WooCommerce RetailCRM
|
||||
|
Loading…
x
Reference in New Issue
Block a user