carls
27-10-07, 03:23
Hi,
I tried for ages trying to import the csv data that you can download, but i gave up (every time i converted it to sql something would be wrong). Now im trying to use the api to just write the sql inserts that i need
this is the code i have at the moment
define('API', 'PS');
require_once('classes/class.ClientFactory.php');
// replace with your own credentials
$oClient= ClientFactory::getClient("xx", 'xx', 'affiliate');
$aHotPicksParams = array('iCategoryId'=> 364, 'iLimit'=> 100, 'iOffset'=> 0);
//make the SOAP call
$oHotPicks = $oClient->call('getHotPickProductList', $aHotPicksParams);
//get the products array
$aProducts = $oHotPicks->getHotPickProductListReturn;
//print each product name to the page
foreach ($aProducts as $oProduct) {
echo " INSERT INTO `fridgefreezer` ( `id` , `name` , `desc` , `spec` , `sawdeeplink` , `sawthumb` , `sawimage` , `sthumburl` , `simageurl` , `price` , `delivery`, `sDeepLink`, `iMerchantId` )
VALUES (
NULL , \"$oProduct->sName\", \"$oProduct->sDesc\", \"$oProduct->sSpec\", \"$oProduct->sAwDeepLink\", \"$oProduct->sAwThumbUrl\", \"$oProduct->sAwImageUrl\", \"$oProduct->sThumbUrl\", \"$oProduct->sImageUrl\", \"$oProduct->fSearchPrice\", \"$oProduct->fDeliveryCost\", \"$oProduct->sDeepLink\", \"$oProduct->iMerchantId\"
);" ;
echo '<br />';
}
(username/pw taken out)
which works - but i want it to not show just the getHotPickProductListReturn - i want them all. How can i do this? And where is the actual documentation? I can't find any that actually describes anything handy, just about installing that pre written script
thanks
I tried for ages trying to import the csv data that you can download, but i gave up (every time i converted it to sql something would be wrong). Now im trying to use the api to just write the sql inserts that i need
this is the code i have at the moment
define('API', 'PS');
require_once('classes/class.ClientFactory.php');
// replace with your own credentials
$oClient= ClientFactory::getClient("xx", 'xx', 'affiliate');
$aHotPicksParams = array('iCategoryId'=> 364, 'iLimit'=> 100, 'iOffset'=> 0);
//make the SOAP call
$oHotPicks = $oClient->call('getHotPickProductList', $aHotPicksParams);
//get the products array
$aProducts = $oHotPicks->getHotPickProductListReturn;
//print each product name to the page
foreach ($aProducts as $oProduct) {
echo " INSERT INTO `fridgefreezer` ( `id` , `name` , `desc` , `spec` , `sawdeeplink` , `sawthumb` , `sawimage` , `sthumburl` , `simageurl` , `price` , `delivery`, `sDeepLink`, `iMerchantId` )
VALUES (
NULL , \"$oProduct->sName\", \"$oProduct->sDesc\", \"$oProduct->sSpec\", \"$oProduct->sAwDeepLink\", \"$oProduct->sAwThumbUrl\", \"$oProduct->sAwImageUrl\", \"$oProduct->sThumbUrl\", \"$oProduct->sImageUrl\", \"$oProduct->fSearchPrice\", \"$oProduct->fDeliveryCost\", \"$oProduct->sDeepLink\", \"$oProduct->iMerchantId\"
);" ;
echo '<br />';
}
(username/pw taken out)
which works - but i want it to not show just the getHotPickProductListReturn - i want them all. How can i do this? And where is the actual documentation? I can't find any that actually describes anything handy, just about installing that pre written script
thanks