Fix analytics code, added filter to process order, fix picture in icml
This commit is contained in:
parent
8fd4a8fe35
commit
b04a9ce701
@ -1,3 +1,8 @@
|
|||||||
|
## 2018-03-22 v.2.1.4
|
||||||
|
* Исправлена ошибка при активированном модуле без настроек
|
||||||
|
* Добавлен фильтр при формировании массива заказа
|
||||||
|
* Исправлена генерация icml с неполной картинкой товара
|
||||||
|
|
||||||
## 2018-03-22 v.2.1.3
|
## 2018-03-22 v.2.1.3
|
||||||
* Исправлена ошибка на php5.3
|
* Исправлена ошибка на php5.3
|
||||||
|
|
||||||
|
@ -416,16 +416,16 @@ if ( ! class_exists( 'WC_Retailcrm_Icml' ) ) :
|
|||||||
*/
|
*/
|
||||||
private function setOffer(&$full_product_list, $product_attributes, $product, $parent = false) {
|
private function setOffer(&$full_product_list, $product_attributes, $product, $parent = false) {
|
||||||
if ($parent) {
|
if ($parent) {
|
||||||
$image = wp_get_attachment_image_src($product->get_image_id());
|
$image = wp_get_attachment_image_src($product->get_image_id(), 'full');
|
||||||
|
|
||||||
if (!$image) {
|
if (!$image) {
|
||||||
$image = wp_get_attachment_image_src($parent->get_image_id());
|
$image = wp_get_attachment_image_src($parent->get_image_id(), 'full');
|
||||||
}
|
}
|
||||||
|
|
||||||
$term_list = $parent->get_category_ids();
|
$term_list = $parent->get_category_ids();
|
||||||
$attributes = get_post_meta($parent->get_id(), '_product_attributes');
|
$attributes = get_post_meta($parent->get_id(), '_product_attributes');
|
||||||
} else {
|
} else {
|
||||||
$image = wp_get_attachment_image_src($product->get_image_id());
|
$image = wp_get_attachment_image_src($product->get_image_id(), 'full');
|
||||||
$term_list = $product->get_category_ids();
|
$term_list = $product->get_category_ids();
|
||||||
$attributes = get_post_meta($product->get_id(), '_product_attributes');
|
$attributes = get_post_meta($product->get_id(), '_product_attributes');
|
||||||
}
|
}
|
||||||
|
@ -432,7 +432,7 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $order_data;
|
return apply_filters('retailcrm_process_order', $order_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Version: 2.1.3
|
* Version: 2.1.4
|
||||||
* Plugin Name: WooCommerce RetailCRM
|
* Plugin Name: WooCommerce RetailCRM
|
||||||
* Plugin URI: https://wordpress.org/plugins/woo-retailcrm/
|
* Plugin URI: https://wordpress.org/plugins/woo-retailcrm/
|
||||||
* Description: Integration plugin for WooCommerce & RetailCRM
|
* Description: Integration plugin for WooCommerce & RetailCRM
|
||||||
@ -362,7 +362,10 @@ function update_order($order_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function initialize_analytics() {
|
function initialize_analytics() {
|
||||||
$options = array_filter(get_option( 'woocommerce_integration-retailcrm_settings' ));
|
$options = get_option('woocommerce_integration-retailcrm_settings');
|
||||||
|
|
||||||
|
if ($options && is_array($options)) {
|
||||||
|
$options = array_filter($options);
|
||||||
|
|
||||||
if (isset($options['ua']) && $options['ua'] == 'yes') {
|
if (isset($options['ua']) && $options['ua'] == 'yes') {
|
||||||
?>
|
?>
|
||||||
@ -386,10 +389,14 @@ function initialize_analytics() {
|
|||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function send_analytics() {
|
function send_analytics() {
|
||||||
$options = array_filter(get_option( 'woocommerce_integration-retailcrm_settings' ));
|
$options = get_option('woocommerce_integration-retailcrm_settings');
|
||||||
|
|
||||||
|
if ($options && is_array($options)) {
|
||||||
|
$options = array_filter($options);
|
||||||
|
|
||||||
if (isset($_GET['key']) && isset($options['ua']) && $options['ua'] == 'yes') {
|
if (isset($_GET['key']) && isset($options['ua']) && $options['ua'] == 'yes') {
|
||||||
$orderid = wc_get_order_id_by_order_key($_GET['key']);
|
$orderid = wc_get_order_id_by_order_key($_GET['key']);
|
||||||
@ -404,9 +411,10 @@ function send_analytics() {
|
|||||||
'price' => (float)$_product->get_price(),
|
'price' => (float)$_product->get_price(),
|
||||||
'quantity' => $item['qty'],
|
'quantity' => $item['qty'],
|
||||||
);
|
);
|
||||||
}
|
|
||||||
$order_items[] = $order_item;
|
$order_items[] = $order_item;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$url = parse_url(get_site_url());
|
$url = parse_url(get_site_url());
|
||||||
$domain = $url['host'];
|
$domain = $url['host'];
|
||||||
@ -435,6 +443,7 @@ function send_analytics() {
|
|||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function retailcrm_load_plugin_textdomain() {
|
function retailcrm_load_plugin_textdomain() {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @link https://wordpress.org/plugins/woo-retailcrm/
|
* @link https://wordpress.org/plugins/woo-retailcrm/
|
||||||
* @since 2.1.3
|
* @since 2.1.4
|
||||||
*
|
*
|
||||||
* @package RetailCRM
|
* @package RetailCRM
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user