1
0
mirror of synced 2024-11-29 08:46:09 +03:00

Correct ICML parameters names for offers

This commit is contained in:
Pavel 2020-04-28 14:16:12 +03:00 committed by GitHub
parent acaaf98c56
commit aee9926dfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 193 deletions

View File

@ -1,3 +1,6 @@
## 2020-04-27 v.5.3.1
* Добавлена локализация свойств при генерации каталога
## 2020-04-23 v.5.3.0 ## 2020-04-23 v.5.3.0
* Добавлена поддержка корпоративных клиентов * Добавлена поддержка корпоративных клиентов

View File

@ -34,6 +34,7 @@ class RetailCrmICML
protected $isLogged = false; protected $isLogged = false;
protected $logFile = '/bitrix/catalog_export/i_crm_load_log.txt'; protected $logFile = '/bitrix/catalog_export/i_crm_load_log.txt';
protected $fpLog; protected $fpLog;
protected $localizedIBlockProps;
protected $MODULE_ID = 'intaro.retailcrm'; protected $MODULE_ID = 'intaro.retailcrm';
protected $CRM_CATALOG_BASE_PRICE = 'catalog_base_price'; protected $CRM_CATALOG_BASE_PRICE = 'catalog_base_price';
@ -69,10 +70,11 @@ class RetailCrmICML
{ {
global $USER; global $USER;
if (!isset($_SESSION["SESS_AUTH"]["USER_ID"]) || !$_SESSION["SESS_AUTH"]["USER_ID"]) { if (!isset($_SESSION["SESS_AUTH"]["USER_ID"]) || !$_SESSION["SESS_AUTH"]["USER_ID"]) {
$USER = new CUser; $USER = new CUser();
} }
$this->isLogged = true; $this->isLogged = true;
$this->localizedIBlockProps = $this->getLocalizedIBlockProps();
$defaultSite = CSite::GetList($by = "def", $order = "desc", array('DEF' => 'Y'))->Fetch(); $defaultSite = CSite::GetList($by = "def", $order = "desc", array('DEF' => 'Y'))->Fetch();
$this->encodingDefault = $defaultSite["CHARSET"]; $this->encodingDefault = $defaultSite["CHARSET"];
@ -647,7 +649,13 @@ class RetailCrmICML
if ($key === "manufacturer") { if ($key === "manufacturer") {
$offer .= "<vendor>" . $this->PrepareValue($arOffer['_PROP_' . $key]) . "</vendor>\n"; $offer .= "<vendor>" . $this->PrepareValue($arOffer['_PROP_' . $key]) . "</vendor>\n";
} else { } else {
$offer .= '<param name="' . $key . '"' . (isset($arOffer['_PROP_' . $key . "_UNIT"]) ? ' unit="' . $arOffer['_PROP_' . $key . "_UNIT"] . '"' : "") . ">" . $this->PrepareValue($arOffer['_PROP_' . $key]) . "</param>\n"; $name = $key;
if (isset($this->localizedIBlockProps[$key])) {
$name = $this->localizedIBlockProps[$key];
}
$offer .= '<param name="' . $name . '" code="' . $key . '"' . (isset($arOffer['_PROP_' . $key . "_UNIT"]) ? ' unit="' . $arOffer['_PROP_' . $key . "_UNIT"] . '"' : "") . ">" . $this->PrepareValue($arOffer['_PROP_' . $key]) . "</param>\n";
} }
} }
} }
@ -656,7 +664,13 @@ class RetailCrmICML
if ($key === "manufacturer") { if ($key === "manufacturer") {
$offer .= "<vendor>" . $this->PrepareValue($arOffer['_PROP_' . $key]) . "</vendor>\n"; $offer .= "<vendor>" . $this->PrepareValue($arOffer['_PROP_' . $key]) . "</vendor>\n";
} else { } else {
$offer .= '<param name="' . $key . '"' . (isset($arOffer['_PROP_' . $key . "_UNIT"]) ? ' unit="' . $arOffer['_PROP_' . $key . "_UNIT"] . '"' : "") . ">" . $this->PrepareValue($arOffer['_PROP_' . $key]) . "</param>\n"; $name = $key;
if (isset($this->localizedIBlockProps[$key])) {
$name = $this->localizedIBlockProps[$key];
}
$offer .= '<param name="' . $name . '" code="' . $key . '"' . (isset($arOffer['_PROP_' . $key . "_UNIT"]) ? ' unit="' . $arOffer['_PROP_' . $key . "_UNIT"] . '"' : "") . ">" . $this->PrepareValue($arOffer['_PROP_' . $key]) . "</param>\n";
} }
} }
} }
@ -713,4 +727,19 @@ class RetailCrmICML
return array(); return array();
} }
private function getLocalizedIBlockProps()
{
return array(
"article" => GetMessage("PROPERTY_ARTICLE_HEADER_NAME"),
"manufacturer" => GetMessage("PROPERTY_MANUFACTURER_HEADER_NAME"),
"color" => GetMessage("PROPERTY_COLOR_HEADER_NAME"),
"size" => GetMessage("PROPERTY_SIZE_HEADER_NAME"),
"weight" => GetMessage("PROPERTY_WEIGHT_HEADER_NAME"),
"length" => GetMessage("PROPERTY_LENGTH_HEADER_NAME"),
"width" => GetMessage("PROPERTY_WIDTH_HEADER_NAME"),
"height" => GetMessage("PROPERTY_HEIGHT_HEADER_NAME"),
"picture" => GetMessage("PROPERTY_PICTURE_HEADER_NAME")
);
}
} }

View File

@ -1,5 +1,5 @@
<? <?
$arModuleVersion = array( $arModuleVersion = array(
"VERSION" => "5.3.0", "VERSION" => "5.3.1",
"VERSION_DATE" => "2020-04-23 16:00:00" "VERSION_DATE" => "2020-04-27 17:45:00"
); );

View File

@ -1,2 +1,11 @@
<?php <?php
$MESS["ROOT_CATEGORY_FOR_CATALOG"] = "Корневой раздел для каталога \"%s\""; $MESS["ROOT_CATEGORY_FOR_CATALOG"] = "Корневой раздел для каталога \"%s\"";
$MESS["PROPERTY_ARTICLE_HEADER_NAME"] = "Артикул";
$MESS["PROPERTY_MANUFACTURER_HEADER_NAME"] = "Производитель";
$MESS["PROPERTY_COLOR_HEADER_NAME"] = "Цвет";
$MESS["PROPERTY_WEIGHT_HEADER_NAME"] = "Вес (габариты)";
$MESS["PROPERTY_LENGTH_HEADER_NAME"] = "Длина (габариты)";
$MESS["PROPERTY_WIDTH_HEADER_NAME"] = "Ширина (габариты)";
$MESS["PROPERTY_HEIGHT_HEADER_NAME"] = "Высота (габариты)";
$MESS["PROPERTY_PICTURE_HEADER_NAME"] = "Фото";
$MESS["PROPERTY_SIZE_HEADER_NAME"] = "Размер";

View File

@ -1436,152 +1436,21 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) {
</td> </td>
</tr> </tr>
<<<<<<< HEAD <tr class="r-cc" <?php if($optionCorpClient !== 'Y') echo 'style="display: none;"'; ?>>
<?php if ($optionInventotiesUpload === 'Y' || count($arResult['bitrixStoresExportList']) > 0) :?> <td colspan="2" class="option-head option-other-top option-other-bottom">
<tr class="heading inventories-batton">
<td colspan="2" class="option-other-heading">
<b>
<label><input class="addr" type="checkbox" name="inventories-upload" value="Y" <?php if($optionInventotiesUpload === 'Y') echo "checked"; ?>><?php echo GetMessage('INVENTORIES_UPLOAD'); ?></label>
</b>
</td>
</tr>
<tr class="inventories" <?php if($optionInventotiesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td colspan="2" class="option-head option-other-top option-other-bottom">
<b><label><?php echo GetMessage('INVENTORIES'); ?></label></b>
</td>
</tr>
<?php foreach ($arResult['bitrixStoresExportList'] as $catalogExportStore): ?>
<tr class="inventories" <?php if($optionInventotiesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td width="50%" class="adm-detail-content-cell-l"><?php echo $catalogExportStore['TITLE'] ?></td>
<td width="50%" class="adm-detail-content-cell-r">
<select class="typeselect" name="stores-export-<?php echo $catalogExportStore['ID']?>">
<option value=""></option>
<?php foreach ($arResult['inventoriesList'] as $inventoriesList): ?>
<option value="<?php echo $inventoriesList['code'] ?>" <?php if($optionStores[$catalogExportStore['ID']] == $inventoriesList['code']) echo 'selected="selected"'; ?>><?php echo $inventoriesList['name']?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php endforeach; ?>
<tr class="inventories" <?php if($optionInventotiesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td colspan="2" class="option-head option-other-top option-other-bottom">
<b>
<label><?php echo GetMessage('SHOPS_INVENTORIES_UPLOAD'); ?></label>
</b>
</td>
</tr>
<?php foreach ($arResult['sitesList'] as $sitesList): ?>
<tr class="inventories" align="center" <?php if($optionInventotiesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td colspan="2" class="option-other-center">
<label><input class="addr" type="checkbox" name="shops-exoprt-<?echo $sitesList['code'];?>" value="Y" <?php if(in_array($sitesList['code'], $optionShops)) echo "checked"; ?>> <?php echo $sitesList['name'].' ('.$sitesList['code'].')'; ?></label>
</td>
</tr>
<?php endforeach;?>
<tr class="inventories" <?php if($optionInventotiesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td colspan="2" class="option-head option-other-top option-other-bottom">
<b>
<label><?php echo GetMessage('IBLOCKS_UPLOAD'); ?></label>
</b>
</td>
</tr>
<?php foreach ($arResult['bitrixIblocksExportList'] as $catalogExportIblock) :?>
<tr class="inventories" align="center" <?php if($optionInventotiesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td colspan="2" class="option-other-center">
<label><input class="addr" type="checkbox" name="iblocks-stores-<?echo $catalogExportIblock['ID'];?>" value="Y" <?php if(in_array($catalogExportIblock['ID'], $optionIblocksInventories)) echo "checked"; ?>> <?php echo '['. $catalogExportIblock['CODE']. '] ' . $catalogExportIblock['NAME'] . ' (' . $catalogExportIblock['LID'] . ')'; ?></label>
</td>
</tr>
<?php endforeach;?>
<?php endif;?>
<?php if ($optionPricesUpload === 'Y' || count($arResult['bitrixPricesExportList']) > 0) :?>
<tr class="heading prices-batton">
<td colspan="2" class="option-other-heading">
<b>
<label><input class="addr" type="checkbox" name="prices-upload" value="Y" <?php if($optionPricesUpload === 'Y') echo "checked"; ?>><?php echo GetMessage('PRICES_UPLOAD'); ?></label>
</b>
</td>
</tr>
<tr class="prices" <?php if($optionPricesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td colspan="2" class="option-head option-other-top option-other-bottom">
<b>
<label><?php echo GetMessage('PRICE_TYPES'); ?></label>
</b>
</td>
</tr>
<?php foreach ($arResult['bitrixPricesExportList'] as $catalogExportPrice) :?>
<tr class="prices" <?php if($optionPricesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td width="50%" class="adm-detail-content-cell-l"><?php echo $catalogExportPrice['NAME_LANG'] . ' (' . $catalogExportPrice['NAME'] . ')'; ?></td>
<td width="50%" class="adm-detail-content-cell-r">
<select class="typeselect" name="price-type-export-<?php echo $catalogExportPrice['ID'];?>">
<option value=""></option>
<?php foreach ($arResult['priceTypeList'] as $priceTypeList): ?>
<option value="<?php echo $priceTypeList['code'] ?>" <?php if($optionPrices[$catalogExportPrice['ID']] == $priceTypeList['code']) echo 'selected="selected"'; ?>><?php echo $priceTypeList['name']?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php endforeach;?>
<tr class="prices" <?php if($optionPricesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td colspan="2" class="option-head option-other-top option-other-bottom">
<b>
<label><?php echo GetMessage('SHOPS_PRICES_UPLOAD'); ?></label>
</b>
</td>
</tr>
<?php foreach ($arResult['sitesList'] as $sitesList): ?>
<tr class="prices" align="center" <?php if($optionPricesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td colspan="2" class="option-other-center">
<label><input class="addr" type="checkbox" name="shops-price-<?echo $sitesList['code'];?>" value="Y" <?php if(in_array($sitesList['code'], $optionPriceShops)) echo "checked"; ?>> <?php echo $sitesList['name'].' ('.$sitesList['code'].')'; ?></label>
</td>
</tr>
<?php endforeach;?>
<tr class="prices" <?php if($optionPricesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td colspan="2" class="option-head option-other-top option-other-bottom">
<b>
<label><?php echo GetMessage('IBLOCKS_UPLOAD'); ?></label>
</b>
</td>
</tr>
<?php foreach ($arResult['bitrixIblocksExportList'] as $catalogExportIblock) :?>
<tr class="prices" align="center" <?php if($optionPricesUpload !== 'Y') echo 'style="display: none;"'; ?>>
<td colspan="2" class="option-other-center">
<label><input class="addr" type="checkbox" name="iblocks-prices-<?echo $catalogExportIblock['ID'];?>" value="Y" <?php if(in_array($catalogExportIblock['ID'], $optionIblocksPrices)) echo "checked"; ?>> <?php echo '['. $catalogExportIblock['CODE']. '] ' . $catalogExportIblock['NAME'] . ' (' . $catalogExportIblock['LID'] . ')'; ?></label>
</td>
</tr>
<?php endforeach;?>
<?php endif;?>
<tr class="heading r-coll-button">
<td colspan="2" class="option-other-heading">
<b> <b>
<label><input class="addr" type="checkbox" name="collector" value="Y" <?php if($optionCollector === 'Y') echo "checked"; ?>><?php echo GetMessage('DEMON_COLLECTOR'); ?></label> <label><?php echo GetMessage('CORP_LABEL');?></label>
</b>
</td>
</tr>
<tr class="r-coll" <?php if($optionCollector !== 'Y') echo 'style="display: none;"'; ?>>
<td class="option-head" colspan="2">
<b><?php echo GetMessage('ICRM_SITES'); ?></b>
</td>
</tr>
<?php foreach ($arResult['arSites'] as $sitesList): ?>
<tr class="r-coll" <?php if($optionCollector !== 'Y') echo 'style="display: none;"'; ?>>
<td class="adm-detail-content-cell-l" width="50%"><?php echo GetMessage('DEMON_KEY'); ?> <?php echo $sitesList['NAME']; ?> (<?php echo $sitesList['LID']; ?>)</td>
<td class="adm-detail-content-cell-r" width="50%">
<input name="collector-id-<?echo $sitesList['LID'];?>" value="<?php echo $optionCollectorKeys[$sitesList['LID']]; ?>" type="text">
</td>
</tr>
<?php endforeach;?>
<tr class="heading r-dc-button">
<td colspan="2" class="option-other-heading">
<b>
<label><input class="addr" type="checkbox" name="discount_round" value="Y" <?php if($optionDiscRound === 'Y') echo "checked"; ?>><?php echo "Округление цены товара при сборе одинаковых товарных позиций" ?></label>
</b> </b>
</td> </td>
</tr> </tr>
<tr class="r-dc" <?php if($optionDiscRound !== 'Y') echo 'style="display: none;"'; ?>> <tr class="r-cc" <?php if($optionCorpClient !== 'Y') echo 'style="display: none;"'; ?>>
<td class="option-head" colspan="2"> <td width="50%" class="" name="<?php ?>" align="center">
<b><?php echo "При включенной опции округление будет происходить в меньшую сторону" ?></b> <?php foreach ($arResult['sitesList'] as $sitesList): ?>
<td colspan="2" class="option-other-center">
<label><input class="addr" type="checkbox" name="shops-corporate-<?echo $sitesList['code'];?>" value="Y" <?php if(in_array($sitesList['code'], $optionCorpShops)) echo "checked"; ?>> <?php echo $sitesList['name'].' ('.$sitesList['code'].')'; ?></label>
</td>
<?php endforeach;?>
</td> </td>
</tr> </tr>
@ -1602,53 +1471,6 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) {
</td> </td>
</tr> </tr>
<tr class="heading r-ua-button">
<td colspan="2" class="option-other-heading">
<b>
<label><input class="addr" type="checkbox" name="ua-integration" value="Y" <?php if($optionUa === 'Y') echo "checked"; ?>><?php echo GetMessage('UNIVERSAL_ANALYTICS'); ?></label>
</b>
</td>
</tr>
<?php foreach ($arResult['arSites'] as $sitesList): ?>
<tr class="r-ua" <?php if($optionUa !== 'Y') echo 'style="display: none;"'; ?>>
<td class="option-head" colspan="2">
<b><?php echo $sitesList['NAME']; ?> (<?php echo $sitesList['LID']; ?>)</b>
</td>
</tr>
<tr class="r-ua" <?php if($optionUa !== 'Y') echo 'style="display: none;"'; ?>>
<td class="adm-detail-content-cell-l" width="50%"><?php echo GetMessage('ID_UA'); ?></td>
<td class="adm-detail-content-cell-r" width="50%">
<input name="ua-id-<?echo $sitesList['LID'];?>" value="<?php echo $optionUaKeys[$sitesList['LID']]['ID']; ?>" type="text">
</td>
</tr>
<tr class="r-ua" <?php if($optionUa !== 'Y') echo 'style="display: none;"'; ?>>
<td class="adm-detail-content-cell-l" width="50%"><?php echo GetMessage('INDEX_UA'); ?></td>
<td class="adm-detail-content-cell-r" width="50%">
<input name="ua-index-<?echo $sitesList['LID'];?>" value="<?php echo $optionUaKeys[$sitesList['LID']]['INDEX']; ?>" type="text">
</td>
</tr>
<?php endforeach;?>
=======
>>>>>>> fix options
<tr class="r-cc" <?php if($optionCorpClient !== 'Y') echo 'style="display: none;"'; ?>>
<td colspan="2" class="option-head option-other-top option-other-bottom">
<b>
<label><?php echo GetMessage('CORP_LABEL');?></label>
</b>
</td>
</tr>
<tr class="r-cc" <?php if($optionCorpClient !== 'Y') echo 'style="display: none;"'; ?>>
<td width="50%" class="" name="<?php ?>" align="center">
<?php foreach ($arResult['sitesList'] as $sitesList): ?>
<td colspan="2" class="option-other-center">
<label><input class="addr" type="checkbox" name="shops-corporate-<?echo $sitesList['code'];?>" value="Y" <?php if(in_array($sitesList['code'], $optionCorpShops)) echo "checked"; ?>> <?php echo $sitesList['name'].' ('.$sitesList['code'].')'; ?></label>
</td>
<?php endforeach;?>
</td>
</tr>
<?php endif;?> <?php endif;?>
<?php $tabControl->Buttons(); ?> <?php $tabControl->Buttons(); ?>
<input type="hidden" name="Update" value="Y" /> <input type="hidden" name="Update" value="Y" />