Warning: Cannot use a scalar value as an array in /home/admin/public_html/forum/include/fm.class.php on line 757

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/include/fm.class.php on line 770
Форумы портала PHP.SU :: Версия для печати :: подключение к emex c помощью скрипта php soap
Форумы портала PHP.SU » » Операционная система и системные вызовы » подключение к emex c помощью скрипта php soap

Страниц (1): [1]
 

1. arsen - 22 Марта, 2014 - 11:56:20 - перейти к сообщению
<?if(!defined("CORE_PROLOG_INCLUDED") || CORE_PROLOG_INCLUDED!==true)die();?>
<?
function GetWSPrices($arPrices, $arNUMBERs, $arArtBrands=Array()){
//Work with array type only
if(!is_array($arNUMBERs) AND $arNUMBERs!=''){$arNUMBERs=Array($arNUMBERs);}

//Extra price ranges
$arExRanges = Array(
0 => 1.4,
1000 => 1.35,
2000 => 1.3,
5000 => 1.25,
10000 => 1.2
);

//////////////////////////////// ///////////////////////
//// emex.ru
//// http://wsdoc[dot]emex[dot]ru/
//////////////////////////////// ///////////////////////

/*if(extension_loaded('soap')){echo '+';
$EmExRes="Y";
$client = new SoapClient("http://ws[dot]emex[dot]ru/EmExService[dot]asmx?wsdl
",array('encoding'=>"utf-8","exception" => 0,'soap_version' => SOAP_1_2)); //echo '<pre>';print_r($client->__getFunctions());echo '</pre>';
$parameters = array(
'login' => 'xxx',
'password' => 'xxx',
'DetailNum' => 'MD352626',
'substLevel' => 'OriginalOnly',
'substFilter' => 'FilterOriginalAndReplacements',
'deliveryRegionType' => 'PRI'
);
try{
$resSClient = $client->FindDetailAdv3($params);
echo '<pre>';print_r($resSClient);echo '</pre>';
}catch (SoapFault $e){
global $TCore;
$TCore->arErrorMessages[] = 'SOAP of emex.ru :: '.$e->faultstring;
$EmExRes="N"; break;
}
if($EmExRes=="Y"){
foreach($resSClient as $arRes){
$arAPrice = Array();
$arAPrice['SUP_BRAND'] = (string)$arRes->MakeLogo;
$arAPrice['ART_ARTICLE_NR'] = (string)$arRes->NewDetailNum;
//if(count($arArtBrands)>0 AND !in_array($arAPrice['SUP_BRAND'],$arArtBrands[$arAPrice['ART_ARTICLE_NR']])){continue;}
$arAPrice['ART_NUM'] = (string)$arRes->NewDetailNum;
$arAPrice['PART_NAME'] = (string)$arRes->DetailNameRus;
//foreach($arExRanges as $Range=>$Extra){ if($arRes['Price']<$Range){break;}else{$arRes['PriceExtra'] = $Extra;} }
$arAPrice['PRICE'] = $arRes->DetailNameRus * 1.3; // round(($arRes['Price']*$arRes['PriceExtra']),2);
$arAPrice['CURRENCY'] = "RUB";
$arAPrice['DAY'] = (string)$arRes->ADDays;
$arAPrice['AVAILABLE'] = (string)$arRes->Quantity;
$arAPrice['SUPPLIER'] = 'emex.ru';
$arAPrice['ID'] = (string)$arRes->DetailNum; // md5($arAPrice['ART_NUM'].$arAPrice['SUP_BRAND'].$arAPrice['PRICE'].$arAPrice['DAY'].$arAPrice['SUPPLIER']);
$arPrices[] = $arAPrice;
}
}
}
}
die();*/

 

Powered by ExBB FM 1.0 RC1