udało mi się przerobić po wielu bojach starą metodę pobierania informacji o aukcjach na nową (w końcu zrozumiałem czemu ktoś w internecie napisał że to Allegro API to koszmar programisty), nie otrzymuję już błędów przy pobieraniu informacji, mam jednak problem z paginacją (stronicowaniem), załączam cały kod, być może przyda się komuś do przejścia na nową metodę:
$offset = ($_GET['id']) ; $limit = 12; $items = $soap->doGetItemsList( 'webapiKey' => 'XXXXXXXX', 'countryId' => 1, 'filterId' => 'userId', ) ) ) ); $items = get_object_vars($items); $ile_stron = $items['itemsCount'] / $limit; if ($offset >= "1") { $back = ($_GET['id'] - 1); } else { $back = $pag; } if ($offset != $ile_stron) { $next = ($_GET['id'] + 1); } else { $next = "0"; } echo "<span style=\"font-size: 16px\"><strong>Strona:</strong></span><br /><div style=\"line-height: 16px;padding-top: 5px\"><a href=\"aukcje?id=".$back."\"><img src=\"images/arrow-left.png\" style=\"padding-right:3px\" /></a> <span style=\"font-size: 16px\"><a href=\"aukcje?id=0\"> 0 </a>"; for($i = 1; $i < $ile_stron; $i++) { } echo " <a href=\"aukcje?id=".$next."\"><img src=\"images/arrow-right.png\" style=\"padding-left:3px\" /></a></span></div><br /><br />"; for($i=0;$i<$limit ;$i++) { echo '<a target="_blank" href="http://allegro.pl/show_item.php?item='.$items[$i]['itemsList']['itemId'].'"><img src="'.$items[$i]['itemsList']['photosInfo']['photoUrl'].'"/></a>'; echo '<div style="width: 130px;margin-top: 5px;margin-bottom: 8px;line-height: 16px"><span style="line-height:14px;font-size: 11px;font-weight: bold">'.$items[$i]['itemsList']['itemTitle'].'</span><br />'; if ($items[$i]['itemsList']['priceInfo']['priceType'] == "buyNow") { echo '<span style="line-height:20px;color: red;font-size: 16px;font-weight: bold">'.$items[$i]['itemsList']['priceInfo']['priceValue'].' zł</span></div>'; } else { echo '<span style="line-height:20px;color: red;font-size: 16px;font-weight: bold">'.$items[$i]['itemsList']['priceInfo']['priceValue'].' zł</span></div>'; } }
problem w tym że serwer zwraca błąd:
Kod
PHP Notice: Undefined offset: 0
PHP Notice: Undefined offset: 1
PHP Notice: Undefined offset: 2
PHP Notice: Undefined offset: 3
PHP Notice: Undefined offset: 4
PHP Notice: Undefined offset: 5
PHP Notice: Undefined offset: 6
PHP Notice: Undefined offset: 7
PHP Notice: Undefined offset: 8
PHP Notice: Undefined offset: 9
PHP Notice: Undefined offset: 10
PHP Notice: Undefined offset: 11
PHP Notice: Undefined offset: 1
PHP Notice: Undefined offset: 2
PHP Notice: Undefined offset: 3
PHP Notice: Undefined offset: 4
PHP Notice: Undefined offset: 5
PHP Notice: Undefined offset: 6
PHP Notice: Undefined offset: 7
PHP Notice: Undefined offset: 8
PHP Notice: Undefined offset: 9
PHP Notice: Undefined offset: 10
PHP Notice: Undefined offset: 11
przypuszczam że mam błąd w kodzie, jednak przejrzałem go już tyle razy i nie mam pojęcia w czym problem, proszę o pomoc