Hi guys,
Everything works on my search - results page except for the fact that Amazon.com returns the results in unformated form. What is going on? What do else do I need to place in my code? Below is a copy of my functions.php. It displays all images and some results in writing that is understandable, but the rest is unformated. Thank you for any replies!
function printCartItem($i){
print("<a href='storeFront.php?removeCart=".$i->CartItemId);
print(processGETString()."'>");
print($i->Title.": ".$i->ItemTotal->FormattedPrice."</a><br>");
}
function error($msg, $err, $result){
print($msg);
if(is_array($err)){
$msg2 = $err[0]->Message;
}
else{
$msg2 = $err->Message;
}
print($msg2);
print_r($result->faultstring);
print("<br><br>");
print_r($result);
}
function printPrevNextPage($totalPages, $pagenum){
$previousPage = processPrevPage($pagenum);
$nextPage = processNextPage($totalPages, $pagenum);
print("<table width='100%'><tr><td width='33%' align='left'>");
print("$previousPage</td>");
print("<td width='33%' align='center'>Page ".$pagenum);
print(" of $totalPages</td>");
print("<td width='33%' align='right'>$nextPage</td></tr></table>");
print("<font size='0'><br><center>The above information came from ");
print("Amazon.com. We make no guarantees to the accuracy of the above ");
print("information.</center></font>");
}
function getKeyword(){
if($GET['keyword'] == ''){
return $GET['displayCat'];
}
else{
return $_GET['keyword'];
}
}
function getOldCat($category){
switch($category){
case 'SportingGoods':
return 'sporting';
case 'OutdoorLiving':
return 'garden';
case 'PCHardware':
return 'pc-hardware';
default:
return $category;
}
}
function getCollectibleValue($param1='', $param2=''){
if($_GET['collectibles'] == "true"){
$ret = 'Collectible';
if($param1 != ''){
$ret .= " $param1";
}
return $ret;
}
else{
return getKeyword($param1, $param2);
}
}
function printItemsSection($title, $items){
print("<center><h3>$title</h3></center>");
print("
<table width='100%' border='0' cellspacing='5' cellpadding='0'>");
if(is_array($items)){
foreach($items as $i){
printItem($i);
}
}
else{
printItem($items);
}
print("</table>");
}
function callSOAPFunction($function, $array){
$params = array('Service' => 'AWSECommerceService',
'AssociateTag' => ASSOCID,
'SubscriptionId' => TOKEN,
'Request' => array($array));
// include class
include('includes/nusoap.php');
$client = new
SoapClient("http://webservices.amazon.com/AWSECommerceService/US/AWSECommerceService.wsdl", true,
array('exceptions' => 0));
$result = $client-> Call($function, array($params));
// print the results of the search
print_r($result);
}
?>