HI,
Can anyone help with Product Search example code in PHP?
Thank.
IntroSites
23-04-08, 10:59
There is an example in the PHP API download
hth
Many thanks. I have found a code.
Hi zudvip,
Could you perhaps point me in the direction of some sample php code?
Thanks,
Simon
Hi,
Here is some php code that I have been using with compliments from authcode
define('API', 'PS');
require_once('classes/class.ClientFactory.php');
// replace with your own credentials
$oClient= ClientFactory::getClient(xxx, 'xxxxxx', 'affiliate');
$params3= array('sQuery'=>'canon digital', 'iLimit'=>9, 'iOffset'=>360, 'sMode'=>'boolean');
$response= $oClient->call('searchProduct', $params3);
print "<pre>";
$sOutput= '';
$sOutput.= $oClient->__getLastRequest();
$sOutput.= $oClient->__getLastResponse();
$sOutput= str_replace('><', ">\n<", $sOutput);
print $sOutput;
#loop through each array element
foreach($response->searchProductReturn as $product) {
#print the product name
echo $product->sName . '<br />';
}
This will print out the product name when searching for "canon digital"
Thanks,
Simon