Warning: Illegal string offset 'article' in
Warning: Illegal string offset 'article_name' in
Warning: Illegal string offset 'brand' in
foreach($Art_List[BrandList] as $key1 => $brand) {
$fields = array("JSONparameter" => "{'Brand': '".$brand[BrandName]."', 'Article': '".$Art_List[Article]."', 'is_main_warehouse: 1 }" ); //Параметр для Апи запроса в формате JSON. Например: {'Brand': 'Monroe', 'Article': 'd5471', 'is_main_warehouse': 0 }
curl_setopt($ch1, CURLOPT_URL, "api.tmparts.ru/api/StockByArticle?".http_build_query($fields));
$Art_List_With_Prices = json_decode(curl_exec($ch1),true);
}
curl_close($ch1);
//foreach($arWsParts as $arPart){
foreach($Art_List_With_Prices as $key2 => $value2){
foreach($arWsParts as $key3 => $arPart) {
//Make valid Price array
$arPrice = TDMPriceArray();
$arPrice["LINK_TO_BKEY"] = $arPart['BKEY']; //If links (cross) number returned
$arPrice["LINK_TO_AKEY"] = $arPart['AKEY']; //If links (cross) number returned
//Webservice data
$arPrice["ARTICLE"] = $value2['article'];
$arPrice["ALT_NAME"] = $value2['article_name'];
$arPrice["BRAND"] = $value2['brand'];
$arPrice["PRICE"] = floatval($value3['price']);
$arPrice["CURRENCY"] = 'USD';
$arPrice["DAY"] = $value3['delivery_period'];
$arPrice["AVAILABLE"] = $value3['quantity'];
$arPrice["STOCK"] = $value3['warehouse_name'];
//Add new record
$arPrices[] = $arPrice;
}
}
//}//foreach