You are here

function amazon_search_search_execute in Amazon Product Advertisement API 7

Same name and namespace in other branches
  1. 7.2 amazon_search/amazon_search.module \amazon_search_search_execute()

Implements hook_search_execute(). Implements remote Amazon searching.

File

amazon_search/amazon_search.module, line 41
Sets up hook_search for Amazon items.

Code

function amazon_search_search_execute($keys = NULL, $conditions = NULL) {
  $products = array();
  $items = amazon_search_simple_search($keys);
  foreach ($items as $item) {
    $products[] = array(
      'title' => '',
      'link' => check_url($item['detailpageurl']),
      'type' => check_plain($item['productgroup']),
      'snippet' => theme('amazon_item', array(
        'item' => $item,
        'style' => 'details',
      )),
      'item' => $item,
    );
  }
  return $products;
}