You are here

function amazon_media_amazon_item_load in Amazon Product Advertisement API 6

Same name and namespace in other branches
  1. 7.2 amazon_media/amazon_media.module \amazon_media_amazon_item_load()
  2. 7 amazon_media/amazon_media.module \amazon_media_amazon_item_load()

File

amazon_media/amazon_media.module, line 70

Code

function amazon_media_amazon_item_load($item) {
  switch ($item['producttypename']) {
    case 'ABIS_BOOK':
    case 'BOOKS_1973_AND_LATER':
      $additions = db_fetch_array(db_query("SELECT * FROM {amazon_book} WHERE asin = '%s'", $item['asin']));
      break;
    case 'VIDEO_DVD':
    case 'ABIS_DVD':
      $additions = db_fetch_array(db_query("SELECT * FROM {amazon_dvd} WHERE asin = '%s'", $item['asin']));
      break;
    case 'ABIS_MUSIC':
      $additions = db_fetch_array(db_query("SELECT * FROM {amazon_music} WHERE asin = '%s'", $item['asin']));
      break;
    case 'CONSOLE_VIDEO_GAMES':
    case 'VIDEO_GAMES':
    case 'SOFTWARE':
      $additions = db_fetch_array(db_query("SELECT * FROM {amazon_software} WHERE asin = '%s'", $item['asin']));
      break;
  }
  if (isset($additions)) {
    return $additions;
  }
}