1
0
mirror of synced 2025-01-31 07:11:42 +03:00

Merge pull request #57 from iyzoer/master

* Исправлена ошибка при активированном модуле без настроек
* Добавлен фильтр при формировании массива заказа
* Исправлена генерация icml с неполной картинкой товара
This commit is contained in:
Alex Lushpai 2018-04-10 11:09:27 +03:00 committed by GitHub
commit 7ad9ae7886
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 73 additions and 59 deletions

View File

@ -1,3 +1,8 @@
## 2018-03-22 v.2.1.4
* Исправлена ошибка при активированном модуле без настроек
* Добавлен фильтр при формировании массива заказа
* Исправлена генерация icml с неполной картинкой товара
## 2018-03-22 v.2.1.3
* Исправлена ошибка на php5.3

View File

@ -416,16 +416,16 @@ if ( ! class_exists( 'WC_Retailcrm_Icml' ) ) :
*/
private function setOffer(&$full_product_list, $product_attributes, $product, $parent = false) {
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) {
$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();
$attributes = get_post_meta($parent->get_id(), '_product_attributes');
} 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();
$attributes = get_post_meta($product->get_id(), '_product_attributes');
}

View File

@ -432,7 +432,7 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) :
}
}
return $order_data;
return apply_filters('retailcrm_process_order', $order_data);
}
/**

View File

@ -1,6 +1,6 @@
<?php
/**
* Version: 2.1.3
* Version: 2.1.4
* Plugin Name: WooCommerce RetailCRM
* Plugin URI: https://wordpress.org/plugins/woo-retailcrm/
* Description: Integration plugin for WooCommerce & RetailCRM
@ -362,7 +362,10 @@ function update_order($order_id) {
}
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') {
?>
@ -387,9 +390,13 @@ function initialize_analytics() {
<?php
}
}
}
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') {
$orderid = wc_get_order_id_by_order_key($_GET['key']);
@ -404,9 +411,10 @@ function send_analytics() {
'price' => (float)$_product->get_price(),
'quantity' => $item['qty'],
);
}
$order_items[] = $order_item;
}
}
$url = parse_url(get_site_url());
$domain = $url['host'];
@ -436,6 +444,7 @@ function send_analytics() {
<?php
}
}
}
function retailcrm_load_plugin_textdomain() {
load_plugin_textdomain('retailcrm', FALSE, basename( dirname( __FILE__ ) ) . '/languages/');

View File

@ -15,7 +15,7 @@
*
*
* @link https://wordpress.org/plugins/woo-retailcrm/
* @since 2.1.3
* @since 2.1.4
*
* @package RetailCRM
*/