You are here

function amazon_versions_amazon_item_clean_xml in Amazon Product Advertisement API 7

Same name and namespace in other branches
  1. 6 amazon_versions/amazon_versions.module \amazon_versions_amazon_item_clean_xml()
  2. 7.2 amazon_versions/amazon_versions.module \amazon_versions_amazon_item_clean_xml()

Implements hook_amazon_item_clean_xml().

File

amazon_versions/amazon_versions.module, line 19
amazon_versions.module Retrieves and stores a list of alternate ASIN numbers for each product.

Code

function amazon_versions_amazon_item_clean_xml(&$item, $xml) {
  if (isset($xml->AlternateVersions->AlternateVersion)) {
    foreach ($xml->AlternateVersions->AlternateVersion as $data) {
      $version = array();
      $version['asin'] = (string) $data->ASIN;
      $version['title'] = (string) $data->Title;
      $version['binding'] = (string) $data->Binding;
      $item['alternateversions'][] = $version;
    }
  }
}