From 09090fdd5fb9d11f41825d237a60cdf7b18a9e6c Mon Sep 17 00:00:00 2001 From: Akolzin Dmitry Date: Tue, 25 Dec 2018 15:07:36 +0300 Subject: [PATCH] v2.3.2 --- CHACNGELOG.md | 3 +++ VERSION | 2 +- src/Model/Icml/Icml.php | 8 +++++++- src/Model/Observer/Customer.php | 2 +- src/composer.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHACNGELOG.md b/CHACNGELOG.md index b19a513..47f4fa3 100644 --- a/CHACNGELOG.md +++ b/CHACNGELOG.md @@ -1,3 +1,6 @@ +## 2018-12-25 v.2.3.2 +* Добавлена выгрузка картинок категорий товаров в ICML + ## 2018-10-25 v.2.3.1 * Добавлена активация модуля в маркетплейсе retailCRM diff --git a/VERSION b/VERSION index a625450..e703481 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.3.1 \ No newline at end of file +2.3.2 \ No newline at end of file diff --git a/src/Model/Icml/Icml.php b/src/Model/Icml/Icml.php index 51bda60..3acf1c9 100644 --- a/src/Model/Icml/Icml.php +++ b/src/Model/Icml/Icml.php @@ -105,7 +105,13 @@ class Icml $e = $this->eCategories->appendChild( $this->dd->createElement('category') ); - $e->appendChild($this->dd->createTextNode($category->getName())); + + $e->appendChild($this->dd->createElement('name', \htmlspecialchars($category->getName()))); + + if ($category->getImageUrl()) { + $e->appendChild($this->dd->createElement('picture', \htmlspecialchars($category->getImageUrl()))); + } + $e->setAttribute('id', $category->getId()); if ($category->getParentId() > 1) { diff --git a/src/Model/Observer/Customer.php b/src/Model/Observer/Customer.php index 2f5753e..de48dcf 100644 --- a/src/Model/Observer/Customer.php +++ b/src/Model/Observer/Customer.php @@ -36,6 +36,7 @@ class Customer implements \Magento\Framework\Event\ObserverInterface $customer = $observer->getEvent()->getCustomer(); $this->customer = $this->serviceCustomer->process($customer); + $this->api->setSite($this->helper->getSite($customer->getStore())); $response = $this->api->customersEdit($this->customer); if ($response === false) { @@ -43,7 +44,6 @@ class Customer implements \Magento\Framework\Event\ObserverInterface } if (!$response->isSuccessful() && $response->errorMsg == $this->api->getErrorText('errorNotFound')) { - $this->api->setSite($this->helper->getSite($customer->getStore())); $this->api->customersCreate($this->customer); } diff --git a/src/composer.json b/src/composer.json index 87a3451..4c327d5 100644 --- a/src/composer.json +++ b/src/composer.json @@ -5,7 +5,7 @@ "retailcrm/api-client-php": "~5.0" }, "type": "magento2-module", - "version": "2.3.1", + "version": "2.3.2", "license": [ "OSL-3.0", "AFL-3.0"