v3.3.8
This commit is contained in:
parent
65482423d6
commit
7ddcafbaba
@ -1,4 +1,7 @@
|
|||||||
## 2018-12-06 v3.3.7
|
## 2018-12-14 v3.3.8
|
||||||
|
* Добавлена выгрузка картинок для категорий товаров в ICML
|
||||||
|
|
||||||
|
## 2018-12-11 v3.3.7
|
||||||
* Исправление бага в активации
|
* Исправление бага в активации
|
||||||
|
|
||||||
## 2018-12-06 v3.3.6
|
## 2018-12-06 v3.3.6
|
||||||
|
@ -175,13 +175,19 @@ if ( ! class_exists( 'WC_Retailcrm_Icml' ) ) :
|
|||||||
/** @var SimpleXMLElement $cat */
|
/** @var SimpleXMLElement $cat */
|
||||||
|
|
||||||
$cat = $this->categories;
|
$cat = $this->categories;
|
||||||
$e = $cat->addChild('category', $category['name']);
|
$e = $cat->addChild('category');
|
||||||
|
|
||||||
$e->addAttribute('id', $category['id']);
|
$e->addAttribute('id', $category['id']);
|
||||||
|
|
||||||
if (array_key_exists('parentId', $category) && $category['parentId'] > 0) {
|
if (array_key_exists('parentId', $category) && $category['parentId'] > 0) {
|
||||||
$e->addAttribute('parentId', $category['parentId']);
|
$e->addAttribute('parentId', $category['parentId']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$e->addChild('name', $category['name']);
|
||||||
|
|
||||||
|
if (array_key_exists('picture', $category)) {
|
||||||
|
$e->addChild('picture', $category['picture']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,14 +397,23 @@ if ( ! class_exists( 'WC_Retailcrm_Icml' ) ) :
|
|||||||
'hide_empty' => $empty
|
'hide_empty' => $empty
|
||||||
);
|
);
|
||||||
|
|
||||||
$wcatTerms = get_categories( $args );
|
$wcatTerms = get_categories($args);
|
||||||
|
|
||||||
foreach ($wcatTerms as $term) {
|
foreach ($wcatTerms as $term) {
|
||||||
$categories[] = array(
|
$category = array(
|
||||||
'id' => $term->term_id,
|
'id' => $term->term_id,
|
||||||
'parentId' => $term->parent,
|
'parentId' => $term->parent,
|
||||||
'name' => $term->name
|
'name' => $term->name
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$thumbnail_id = get_woocommerce_term_meta($term->term_id, 'thumbnail_id', true);
|
||||||
|
$picture = wp_get_attachment_url($thumbnail_id);
|
||||||
|
|
||||||
|
if ($picture) {
|
||||||
|
$category['picture'] = $picture;
|
||||||
|
}
|
||||||
|
|
||||||
|
$categories[] = $category;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $categories;
|
return $categories;
|
||||||
@ -406,12 +421,12 @@ if ( ! class_exists( 'WC_Retailcrm_Icml' ) ) :
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set offer for icml catalog
|
* Set offer for icml catalog
|
||||||
*
|
*
|
||||||
* @param array $full_product_list
|
* @param array $full_product_list
|
||||||
* @param array $product_attributes
|
* @param array $product_attributes
|
||||||
* @param object WC_Product_Simple | WC_Product_Variation $product
|
* @param object WC_Product_Simple | WC_Product_Variation $product
|
||||||
* @param object WC_Product_Variable $parent default false
|
* @param mixed WC_Product_Variable | bool $parent default false
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function setOffer(&$full_product_list, $product_attributes, $product, $parent = false) {
|
private function setOffer(&$full_product_list, $product_attributes, $product, $parent = false) {
|
||||||
@ -477,13 +492,13 @@ if ( ! class_exists( 'WC_Retailcrm_Icml' ) ) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
$product_data = array(
|
$product_data = array(
|
||||||
'id' => $product->get_id(),
|
'id' => $product->get_id(),
|
||||||
'productId' => ($this->get_parent_product($product) > 0) ? $parent->get_id() : $product->get_id(),
|
'productId' => ($product->get_parent_id() > 0) ? $parent->get_id() : $product->get_id(),
|
||||||
'name' => $product->get_name(),
|
'name' => $product->get_name(),
|
||||||
'productName' => ($this->get_parent_product($product) > 0) ? $parent->get_title() : $product->get_title(),
|
'productName' => ($product->get_parent_id() > 0) ? $parent->get_title() : $product->get_title(),
|
||||||
'price' => $this->get_price_with_tax($product),
|
'price' => wc_get_price_including_tax($product),
|
||||||
'picture' => $image[0],
|
'picture' => $image[0],
|
||||||
'url' => ($this->get_parent_product($product) > 0) ? $parent->get_permalink() : $product->get_permalink(),
|
'url' => ($product->get_parent_id() > 0) ? $parent->get_permalink() : $product->get_permalink(),
|
||||||
'quantity' => is_null($product->get_stock_quantity()) ? 0 : $product->get_stock_quantity(),
|
'quantity' => is_null($product->get_stock_quantity()) ? 0 : $product->get_stock_quantity(),
|
||||||
'categoryId' => $term_list,
|
'categoryId' => $term_list,
|
||||||
'dimension' => $dimension,
|
'dimension' => $dimension,
|
||||||
@ -498,49 +513,13 @@ if ( ! class_exists( 'WC_Retailcrm_Icml' ) ) :
|
|||||||
if (isset($product_data)) {
|
if (isset($product_data)) {
|
||||||
$full_product_list[] = $product_data;
|
$full_product_list[] = $product_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($product_data);
|
unset($product_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get product id
|
|
||||||
*
|
|
||||||
* @global object $woocommerce
|
|
||||||
*
|
|
||||||
* @param object $product
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
private function get_parent_product($product) {
|
|
||||||
global $woocommerce;
|
|
||||||
if ( version_compare( $woocommerce->version, '3.0', '<' ) ) {
|
|
||||||
return $product->get_parent();
|
|
||||||
} else {
|
|
||||||
return $product->get_parent_id();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get product price
|
|
||||||
*
|
|
||||||
* @global object $woocommerce
|
|
||||||
*
|
|
||||||
* @param object $product
|
|
||||||
*
|
|
||||||
* @return float
|
|
||||||
*/
|
|
||||||
private function get_price_with_tax($product) {
|
|
||||||
global $woocommerce;
|
|
||||||
if ( version_compare( $woocommerce->version, '3.0', '<' ) ) {
|
|
||||||
return $product->get_price_including_tax();
|
|
||||||
} else {
|
|
||||||
return wc_get_price_including_tax($product);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get product statuses
|
* Get product statuses
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function checkPostStatuses() {
|
private function checkPostStatuses() {
|
||||||
|
@ -45,7 +45,10 @@ API-ключ должен быть для отдельного магазина
|
|||||||
2. В появившихся списках справочников настройте соответствие способов доставки и оплаты, а так же статусов заказов. Отметьте галочку "Выгружать остатки", если хотите выгружать остатки из Retailcrm в магазин (подробнее смотрите в описании).
|
2. В появившихся списках справочников настройте соответствие способов доставки и оплаты, а так же статусов заказов. Отметьте галочку "Выгружать остатки", если хотите выгружать остатки из Retailcrm в магазин (подробнее смотрите в описании).
|
||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
= 3.3.6 =
|
= 3.3.8 =
|
||||||
|
* Добавлена выгрузка картинок для категорий товаров в ICML
|
||||||
|
|
||||||
|
= 3.3.7 =
|
||||||
* Исправлен баг активации модуля интеграции
|
* Исправлен баг активации модуля интеграции
|
||||||
|
|
||||||
= 3.3.6 =
|
= 3.3.6 =
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Version: 3.3.7
|
* Version: 3.3.8
|
||||||
* WC requires at least: 3.0
|
* WC requires at least: 3.0
|
||||||
* WC tested up to: 3.4.3
|
* WC tested up to: 3.4.3
|
||||||
* Plugin Name: WooCommerce RetailCRM
|
* Plugin Name: WooCommerce RetailCRM
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @link https://wordpress.org/plugins/woo-retailcrm/
|
* @link https://wordpress.org/plugins/woo-retailcrm/
|
||||||
* @version 3.3.7
|
* @version 3.3.8
|
||||||
*
|
*
|
||||||
* @package RetailCRM
|
* @package RetailCRM
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user