/**
  * 
  * 'Operation' => 'ItemSearch',    // ItemSearch, ItemLookup, SimilarityLookup
  * @since   2.0.2
  * @see     http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemSearch.html
  */
 protected function getAPIParameterArray($sOperation = 'ItemSearch', $iItemPage = null)
 {
     $_bIsIndexAllOrBlended = 'All' === $this->arrArgs['SearchIndex'] || 'Blended' === $this->arrArgs['SearchIndex'];
     $_aParams = array('Keywords' => AmazonAutoLinks_Utilities::trimDelimitedElements($this->arrArgs['Keywords'], ',', false), 'Title' => $_bIsIndexAllOrBlended ? null : AmazonAutoLinks_Utilities::trimDelimitedElements($this->arrArgs['Title'], ',', false), 'Operation' => $this->arrArgs['Operation'], 'SearchIndex' => $this->arrArgs['SearchIndex'], $this->arrArgs['search_by'] => $this->arrArgs['additional_attribute'] ? $this->arrArgs['additional_attribute'] : null, 'Sort' => $_bIsIndexAllOrBlended ? null : $this->arrArgs['Sort'], 'ResponseGroup' => "Large", 'BrowseNode' => !$_bIsIndexAllOrBlended && isset($this->arrArgs['BrowseNode']) && $this->arrArgs['BrowseNode'] ? $this->arrArgs['BrowseNode'] : null, 'Availability' => isset($this->arrArgs['Availability']) && $this->arrArgs['Availability'] ? 'Available' : null, 'Condition' => $_bIsIndexAllOrBlended ? null : $this->arrArgs['Condition'], 'IncludeReviewsSummary' => "True", 'MaximumPrice' => !$_bIsIndexAllOrBlended && $this->arrArgs['MaximumPrice'] ? $this->arrArgs['MaximumPrice'] : null, 'MinimumPrice' => !$_bIsIndexAllOrBlended && $this->arrArgs['MinimumPrice'] ? $this->arrArgs['MinimumPrice'] : null, 'MinPercentageOff' => $this->arrArgs['MinPercentageOff'] ? $this->arrArgs['MinPercentageOff'] : null, 'MerchantId' => 'Amazon' === $this->arrArgs['MerchantId'] ? $this->arrArgs['MerchantId'] : null, 'MarketplaceDomain' => 'Marketplace' === $this->arrArgs['SearchIndex'] ? AmazonAutoLinks_Properties::getMarketplaceDomainByLocale($this->arrArgs['country']) : null);
     $_aParams = $iItemPage ? $_aParams + array('ItemPage' => $iItemPage) : $_aParams;
     return $_aParams;
 }
 /**
  * 
  * @remark            The scope is public because it is access from the meta box class as well.
  */
 public function getFieldOfItemLookUp($strSectionID, $strPrefix)
 {
     $bIsSearchUnitType = in_array($GLOBALS['strAmazonAutoLinks_UnitType'], array('search', 'item_lookup', 'similarity_lookup '));
     $arrUnitOptions = isset($_REQUEST['transient_id']) ? AmazonAutoLinks_WPUtilities::getTransient('AAL_CreateUnit_' . $_REQUEST['transient_id']) : ($bIsSearchUnitType && isset($_GET['post']) && $_GET['post'] != 0 ? $GLOBALS['oAmazonAutoLinks_Option']->getUnitOptionsByPostID($_GET['post']) : array());
     $bUPCAllowed = isset($arrUnitOptions['country']) && $arrUnitOptions['country'] != 'CA';
     $bISBNAllowed = isset($arrUnitOptions['country']) && $arrUnitOptions['country'] == 'US';
     return array(array('strFieldID' => $strPrefix . 'unit_title', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Unit Name', 'amazon-auto-links'), 'strType' => 'text', 'fIf' => isset($_REQUEST['transient_id']), 'vValue' => isset($arrUnitOptions['unit_title']) ? $arrUnitOptions['unit_title'] : null), array('strFieldID' => $strPrefix . 'ItemId', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Item ID', 'amazon-auto-links'), 'strType' => 'text', 'vSize' => version_compare($GLOBALS['wp_version'], '3.8', '>=') ? 40 : 60, 'strDescription' => __('Enter the ID(s) of the product. For more more than one items, use the <code>,</code> (comma) characters to delimit the items.', 'amazon-auto-links') . ' e.g. <code>B009ZVO3H6, B0043D2DZA</code>', 'vValue' => ''), array('strFieldID' => $strPrefix . 'IdType', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('ID Type', 'amazon-auto-links'), 'strType' => 'radio', 'vLabel' => array('ASIN' => 'ASIN', 'SKU' => 'SKU', 'UPC' => '<span class="' . ($bUPCAllowed ? "" : "disabled") . '">UPC <span class="description">(' . __('Not available in the CA locale.', 'amazon-auto-links') . ')</span></span>', 'EAN' => 'EAN', 'ISBN' => '<span class="' . ($bISBNAllowed ? "" : "disabled") . '">ISBN <span class="description">(' . __('The US locale only, when the search index is Books.', 'amaozn-auto-links') . ')</span></span>'), 'vDisable' => array('ASIN' => false, 'SKU' => false, 'UPC' => $bUPCAllowed ? false : true, 'EAN' => false, 'ISBN' => $bISBNAllowed ? false : true), 'vDefault' => 'ASIN'), array('strFieldID' => $strPrefix . 'search_type', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Search Type', 'amazon-auto-links'), 'strType' => 'text', 'vDisable' => true, 'vReadOnly' => true, 'vValue' => isset($arrUnitOptions['Operation']) ? $this->getSearchTypeLabel($arrUnitOptions['Operation']) : null), array('strFieldID' => $strPrefix . 'Operation', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Operation', 'amazon-auto-links'), 'strType' => 'hidden', 'vReadOnly' => true, 'vValue' => isset($arrUnitOptions['Operation']) ? $arrUnitOptions['Operation'] : null), array('strFieldID' => $strPrefix . 'country', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Locale', 'amazon-auto-links'), 'strType' => 'text', 'vReadOnly' => true, 'vValue' => isset($arrUnitOptions['country']) ? $arrUnitOptions['country'] : null), array('strFieldID' => $strPrefix . 'associate_id', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Associate ID', 'amazon-auto-links'), 'strType' => 'text', 'strDescription' => 'e.g. <code>miunosoft-20</code>', 'vValue' => isset($arrUnitOptions['associate_id']) ? $arrUnitOptions['associate_id'] : null), array('strFieldID' => $strPrefix . 'SearchIndex', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Categories', 'amazon-auto-links'), 'strType' => 'select', 'vLabel' => AmazonAutoLinks_Properties::getSearchIndexByLocale(isset($arrUnitOptions['country']) ? $arrUnitOptions['country'] : null), 'vDefault' => 'All', 'vValue' => isset($arrUnitOptions['SearchIndex']) ? $arrUnitOptions['SearchIndex'] : null, 'strDescription' => __('Select the category to limit the searching area.', 'amazon-auto-links') . ' ' . __('If the above ID Type is ISBN, this will be automatically set to Books.', 'amazon-auto-links') . ' ' . __('If the ID Type is ASIN this option will not take effect.', 'amazon-auto-links')), array('strFieldID' => $strPrefix . 'image_size', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Image Size', 'amazon-auto-links'), 'strType' => 'number', 'vAfterInputTag' => ' ' . __('pixel', 'amazon-auto-links'), 'vDelimiter' => '', 'strDescription' => __('The maximum width of the product image in pixel. Set <code>0</code> for no image.', 'amazon-auto-links') . ' ' . __('Max', 'amazon-auto-links') . ': <code>500</code> ' . __('Default', 'amazon-auto-links') . ': <code>160</code>', 'vMax' => 500, 'vMin' => 0, 'vDefault' => 160), array('strFieldID' => $strPrefix . 'ref_nosim', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Direct Link Bonus', 'amazon-auto-links'), 'strType' => 'radio', 'vLabel' => array(1 => __('On', 'amazon-auto-links'), 0 => __('Off', 'amazon-auto-links')), 'strDescription' => sprintf(__('Inserts <code>ref=nosim</code> in the link url. For more information, visit <a href="%1$s">this page</a>.', 'amazon-auto-links'), 'https://affiliate-program.amazon.co.uk/gp/associates/help/t5/a21'), 'vDefault' => 0), array('strFieldID' => $strPrefix . 'title_length', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Title Length', 'amazon-auto-links'), 'strType' => 'number', 'strDescription' => __('The allowed character length for the title.', 'amazon-auto-links') . '&nbsp;' . __('Use it to prevent a broken layout caused by a very long product title. Set -1 for no limit.', 'amazon-auto-links') . '<br />' . __('Default', 'amazon-auto-links') . ": <code>-1</code>", 'vDefault' => -1), array('strFieldID' => $strPrefix . 'description_length', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Description Length', 'amazon-auto-links'), 'strType' => 'number', 'strDescription' => __('The allowed character length for the description.', 'amazon-auto-links') . '&nbsp;' . __('Set -1 for no limit.', 'amazon-auto-links') . '<br />' . __('Default', 'amazon-auto-links') . ": <code>250</code>", 'vDefault' => 250), array('strFieldID' => $strPrefix . 'link_style', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Link Style', 'amazon-auto-links'), 'strType' => 'radio', 'vLabel' => array(1 => 'http://www.amazon.<code>[domain-suffix]</code>/<code>[product-name]</code>/dp/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>' . "&nbsp;<span class='description'>(" . __('Default', 'amazon-auto-links') . ")</span>", 2 => 'http://www.amazon.<code>[domain-suffix]</code>/exec/obidos/ASIN/<code>[asin]</code>/<code>[associate-id]</code>/ref=<code>[...]</code>', 3 => 'http://www.amazon.<code>[domain-suffix]</code>/gp/product/<code>[asin]</code>/?tag=<code>[associate-id]</code>&ref=<code>[...]</code>', 4 => 'http://www.amazon.<code>[domain-suffix]</code>/dp/ASIN/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>', 5 => site_url() . '?' . $GLOBALS['oAmazonAutoLinks_Option']->arrOptions['aal_settings']['query']['cloak'] . '=<code>[asin]</code>&locale=<code>[...]</code>&tag=<code>[associate-id]</code>'), 'vDefault' => 1), array('strFieldID' => $strPrefix . 'credit_link', 'strSectionID' => $strSectionID ? $strSectionID : null, 'strTitle' => __('Credit Link', 'amazon-auto-links'), 'strType' => 'radio', 'vLabel' => array(1 => __('On', 'amazon-auto-links'), 0 => __('Off', 'amazon-auto-links')), 'strDescription' => sprintf(__('Inserts the credit link at the end of the unit output.', 'amazon-auto-links'), ''), 'vDefault' => 1));
 }