PDA

View Full Version : Hardcoding brand/team filters


mgzr
10-12-08, 14:24
Hi

We are building an affiliate website for a client, to list all branded products of a particular sports team.

At the moment, the site is set up to only display sports clothing regardless of team/club etc..

How would I go about hardcoding a permanent filter and/or search term in the code so only the sports team we want is listed, and exclude all the rest?

mgzr
10-12-08, 16:04
Ok, found the solution!

I downloaded the generic API client example files and had a look through them.

You need to modify product_display_list.php in \elements:

// load env vars into params obj
$oShopCore->syncApiParams($oProductDisplayListParams);

// Search for filtered terms e.g. "nintendo wii"
$oProductDisplayListParams->sQuery = "nintendo wii";

if ( ADULT_CONTENT === false ) {
$oProductDisplayListParams->bAdult = false;
}

Further options can also be added, list is below:

$oProductDisplayListParams->sQuery = "nintendo wii";
$oProductDisplayListParams->iCategoryId = array(4,8);
$oProductDisplayListParams->bExpandAllBranches = false;
$oProductDisplayListParams->iProductId = array(25654634, 4662114, 7154706);
$oProductDisplayListParams->iMerchantId = 1514;
$oProductDisplayListParams->sMerchantProductId = "854";
$oProductDisplayListParams->bAdult = false;
$oProductDisplayListParams->iLimit = 100;
$oProductDisplayListParams->oActiveRefineByGroup = $oRefineBy;
$oProductDisplayListParams->iMaxResult = 3;
$oProductDisplayListParams->bUseGlobalList = true;

Etc.