From f3f27af3a093d40df548f179b6f2d318d09e245f Mon Sep 17 00:00:00 2001 From: Sergey Chazov Date: Thu, 3 Feb 2022 15:17:19 +0400 Subject: [PATCH] Fix bug with ProductType --- intaro.retailcrm/lib/icml/icmldirector.php | 2 +- intaro.retailcrm/lib/icml/xmlofferbuilder.php | 2 +- intaro.retailcrm/lib/model/bitrix/xml/xmloffer.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/intaro.retailcrm/lib/icml/icmldirector.php b/intaro.retailcrm/lib/icml/icmldirector.php index fe702980..384a0437 100644 --- a/intaro.retailcrm/lib/icml/icmldirector.php +++ b/intaro.retailcrm/lib/icml/icmldirector.php @@ -251,7 +251,7 @@ class IcmlDirector do { //Если каталог проиндексирован, у товара есть Тип и это простой товар, то просто записываем его - if ($product->productType = ProductTable::TYPE_PRODUCT) { + if ($product->productType === ProductTable::TYPE_PRODUCT) { $this->icmlWriter->writeOffers([$product]); break; } diff --git a/intaro.retailcrm/lib/icml/xmlofferbuilder.php b/intaro.retailcrm/lib/icml/xmlofferbuilder.php index 4d8d3c85..c608cfba 100644 --- a/intaro.retailcrm/lib/icml/xmlofferbuilder.php +++ b/intaro.retailcrm/lib/icml/xmlofferbuilder.php @@ -225,7 +225,7 @@ class XmlOfferBuilder { $this->xmlOffer->id = $item['ID']; $this->xmlOffer->productId = $item['ID']; - $this->xmlOffer->productType = $item['CATALOG_TYPE']; + $this->xmlOffer->productType = (int) $item['CATALOG_TYPE']; $this->xmlOffer->quantity = $item['CATALOG_QUANTITY'] ?? ''; $this->xmlOffer->url = $item['DETAIL_PAGE_URL'] ? $this->defaultServerName . $item['DETAIL_PAGE_URL'] diff --git a/intaro.retailcrm/lib/model/bitrix/xml/xmloffer.php b/intaro.retailcrm/lib/model/bitrix/xml/xmloffer.php index 54b63980..1f37e13b 100644 --- a/intaro.retailcrm/lib/model/bitrix/xml/xmloffer.php +++ b/intaro.retailcrm/lib/model/bitrix/xml/xmloffer.php @@ -125,7 +125,7 @@ class XmlOffer * \Bitrix\Catalog\ProductTable::TYPE_SKU – товар с торговыми предложениями * \Bitrix\Catalog\ProductTable::TYPE_OFFER – торговое предложение * - * @var mixed + * @var int */ public $productType;