bug fix ICMLLoader.php
This commit is contained in:
parent
6bb71edd15
commit
2a66f0a67b
@ -9,43 +9,13 @@ class ICMLLoader {
|
||||
public $encoding = 'utf-8';
|
||||
|
||||
protected $fp;
|
||||
public static function AgentLoad3( $filename)
|
||||
{
|
||||
echo $filename;
|
||||
$arFilename = "'" . $filename . "'";
|
||||
return "ICMLLoader::AgentLoad( " . $arFilename . ");";
|
||||
|
||||
}
|
||||
public static function AgentLoad($iblocks, $filename)
|
||||
{
|
||||
|
||||
if (!CModule::IncludeModule("iblock")) {
|
||||
//handle err
|
||||
self::eventLog('ICMLLoader::AgentLoad', 'iblock', 'module not found');
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!CModule::IncludeModule("catalog")) {
|
||||
//handle err
|
||||
self::eventLog('ICMLLoader::AgentLoad', 'catalog', 'module not found');
|
||||
return true;
|
||||
}
|
||||
|
||||
global $APPLICATION, $USER;
|
||||
if(!isset($USER)) {
|
||||
$USER = new CUser;
|
||||
}
|
||||
$loader = new ICMLLoader();
|
||||
$loader->iblocks = json_decode($iblocks, true);
|
||||
$loader->filename = $filename;
|
||||
$loader->application = $APPLICATION;
|
||||
$loader->Load();
|
||||
$arIblocks = "'" . $iblocks . "'";
|
||||
$arFilename = "'" . $filename . "'";
|
||||
return "ICMLLoader::AgentLoad(" . $arIblocks . ", " . $arFilename . ");";
|
||||
}
|
||||
public function Load()
|
||||
{
|
||||
global $USER;
|
||||
if(!isset($USER))
|
||||
$USER = new CUser;
|
||||
|
||||
$categories = $this->GetCategories();
|
||||
|
||||
$offers = $this->GetOffers();
|
||||
@ -297,8 +267,6 @@ class ICMLLoader {
|
||||
}
|
||||
|
||||
$offer .= "<name>" . $this->PrepareValue($arOffer["NAME"]) . "</name>\n";
|
||||
$offer .= "<description>" . (strip_tags( html_entity_decode(str_replace(" ", ' ', $this->PrepareValue($arOffer["DETAIL_TEXT"]))))) ."</description>\n";
|
||||
|
||||
|
||||
$offer .= "<xmlId>" . $this->PrepareValue($arOffer["EXTERNAL_ID"]) . "</xmlId>\n";
|
||||
$offer .= "<productName>" . $this->PrepareValue($arOffer["PRODUCT_NAME"]) . "</productName>\n";
|
||||
|
Loading…
Reference in New Issue
Block a user