A Single Merchant with voucher codes if applicable
I’ve posted this in the shopwindow forum as well, but here it is again.
You will need to have the classes folder and the constants.inc.php file found here
<? define('API', 'PS'); require_once('constants.inc.php'); require_once('classes/class.ClientFactory.php'); $oClient = ClientFactory::getClient(); $merchantcolumns = array(sStrapline,sDescription,sLogoUrl,sDisplayUrl,sClickThroughUrl,oDiscountCode); $singlemerchantwithcodes = array('iMerchantId' => array(429), "sColumnToReturn" => $merchantcolumns); $oResponse= $oClient->call('getMerchant', $singlemerchantwithcodes); $iId = $oResponse->oMerchant->iId; $sName =$oResponse->oMerchant->sName; $sStrapline = $oResponse->oMerchant->sStrapline; $sDescription = $oResponse->oMerchant->sDescription; $sLogoUrl = $oResponse->oMerchant->sLogoUrl; $sDisplayUrl = $oResponse->oMerchant->sDisplayUrl; $sClickThroughUrl = $oResponse->oMerchant->sClickThroughUrl; echo '<a href="'.$sClickThroughUrl.'" title="'.$sName.'">'.$sName.'</a><br/>'.$sStrapline.'<br/><img src="'.$sLogoUrl.'" alt="'.$sName.'" /><br/>'.$sDescription.''; $arraycheck1 = $oResponse->oMerchant->oDiscountCode; if(!empty($arraycheck1)){ echo '<div style="margin: 5px 0; background: #D5D5D5; line-height: 0; height: 1px;"></div><h3>Vouchers for '.$sName.'</h3>'; foreach($oResponse->oMerchant->oDiscountCode as $key=>$details2){ $sCode = $details2->sCode; $sDescription = $details2->sDescription; $sUrl = $details2->sUrl; $sEndDate = $details2->sEndDate; if ($sUrl<>'' and $key<7) { echo '<div style="margin: 5px 0; background: #D5D5D5; line-height: 0; height: 1px;"></div><a href="'.$sUrl.'" title="'.$sName.'"><img src="'.$sLogoUrl.'" alt="'.$sName.'" border="0"/></a><br><b>Voucher Code: <a href="'.$sUrl.'">'.$sCode.'</a></b><br/> <font color="red">(Expires '.$sEndDate.')</font><br/>'.$sDescription.''; } } } ?>




