Merge branch 'master' of https://github.com/merelendor/evoleasing-site
This commit is contained in:
commit
3485e92c8f
@ -508,6 +508,8 @@ class DromXMLGenerator
|
||||
$offer->addChild($k, $v);
|
||||
}
|
||||
|
||||
$offer->addChild("Additional", "Артикул: ".$entry['CODE']."\n".str_replace([" ", "<br>", "<br/>"], [" ", "", ""], strip_tags($entry['DETAIL_TEXT'])));
|
||||
|
||||
if(count($entry['PHOTOS_1080']) > 0)
|
||||
{
|
||||
$photos = $offer->addChild("Photos");
|
||||
|
||||
@ -686,8 +686,6 @@ function OnBeforeIBlockElement($arFields)
|
||||
{
|
||||
if($arFields['MODULE_ID'] == "iblock" && $arFields['PARAM2'] == IBLOCK_ID_CATALOG_CARS_USED)
|
||||
{
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_index_".$arFields['PARAM2'].".txt", var_export($arFields, true)."\n", FILE_APPEND);
|
||||
|
||||
if(array_key_exists("BODY", $arFields))
|
||||
{
|
||||
preg_match("/CODE\=(\d+_\d+)/", $arFields['URL'], $matches);
|
||||
@ -695,14 +693,19 @@ function OnBeforeIBlockElement($arFields)
|
||||
|
||||
if(!empty($code))
|
||||
{
|
||||
if(strpos($arFields["BODY"], $code) < 0)
|
||||
preg_match("/\s".$code."/", $arFields["BODY"], $code_matches);
|
||||
if(count($code_matches) == 0)
|
||||
{
|
||||
$arFields["BODY"] .= " ".$code;
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_index_".$arFields['PARAM2'].".txt", "CODE = ".$code." INDEX\n", FILE_APPEND);
|
||||
}
|
||||
else
|
||||
{
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_index_".$arFields['PARAM2'].".txt", "CODE = ".$code." EXISTS\n", FILE_APPEND);
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_index_".$arFields['PARAM2']."_dump.txt", $arFields["BODY"]."\n".str_repeat("-", 150)."\n\n", FILE_APPEND);
|
||||
}
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_index_".$arFields['PARAM2'].".txt", "CODE = ".$code."\n", FILE_APPEND);
|
||||
}
|
||||
}
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_index_".$arFields['PARAM2'].".txt", "\n".str_repeat("-", 150)."\n\n", FILE_APPEND);
|
||||
}
|
||||
|
||||
return $arFields;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user