Hook: exporter_manipulateProductSearch

Bevor die Produktsuche bei Verwendung einer Produkt-Datenquelle ausgeführt wird

/*
 * -- Registration: --
 * $GLOBALS['MERCONIS_HOOKS']['exporter_manipulateProductSearch'][] = array('myMerconisHookClass', 'myExporter_manipulateProductSearch');
 *
 * -- Invocation: --
 * Before the product search is being performed when using a product data source.
 *
 * -- Parameters: --
 * 1. $obj_productSearch - a reference to the product searcher object object
 * 2. $arr_searchCriteria - the search criteria that have been determined so far and would be used if this hooked function would not manipulate them
 *
 * -- Return value: --
 * no return value
 *
 * -- Objective: --
 * manipulating the product search, e.g. by setting customized search criteria or sorting options
 *
 */
 
public function myExporter_manipulateProductSearch(&$obj_productSearch, $arr_searchCriteria) {

   /*
    * e.g. performing a search that would only return unpublished products and sort them
    * by their "new" flag (first level) and their alias (second level)
    */
    
   $arr_searchCriteria = array(
      'published' => ''
   );
   $obj_productSearch->setSearchCriteria($arr_searchCriteria);
   $arr_sorting = array(
      0 => array('field' => 'lsShopProductIsNew', 'direction' => 'DESC'),
      1 => array('field' => 'alias', 'direction' => 'DESC')
   );
   $obj_productSearch->sorting = $arr_sorting;
}