示例#1
0
 public function ce_run_custom_event_hook()
 {
     $schedules = CE_Ebay::get_schedule_option();
     foreach ($schedules as $key => $option) {
         if ($option['ON']) {
             CE_Ebay_API::ebay_search_import($option);
         }
     }
 }
示例#2
0
 public static function ebay_search_import($option)
 {
     $options = CE_Ebay::get_option();
     extract($option);
     $paged = isset($paged) ? $paged : 1;
     if (!is_numeric($number) || $number < 1) {
         $number = 3;
     }
     $url = self::URL_API_SEARCH;
     $url .= '&GLOBAL-ID=' . $site;
     $url .= '&SECURITY-APPNAME=' . $options['app_id'];
     //$url .= '&RESPONSE-DATA-FORMAT=XML&outputSelector[0]=SellerInfo&outputSelector[1]=PictureURLLarge';
     $url .= '&RESPONSE-DATA-FORMAT=XML&outputSelector[0]=PictureURLLarge';
     $url .= "&paginationInput.entriesPerPage=" . $number;
     $url .= "&paginationInput.pageNumber=" . $paged;
     if ($options['use_affiliate']) {
         $url .= '&affiliate.networkId=' . $options['network_id'];
         $url .= '&affiliate.trackingId=' . $options['tracking_id'];
         $url .= '&affiliate.customId=' . $options['custom_id'];
     }
     if (!empty($user_id)) {
         $url .= "&itemFilter(0).name=Seller";
         $url .= "&itemFilter(0).value={$user_id}";
     }
     if (!empty($keywords)) {
         $url .= '&keywords=' . $keywords;
     }
     if ($category != '-1') {
         $url .= '&categoryId=' . $category;
     }
     $items = array();
     $resp = simplexml_load_file($url);
     if ($resp->ack == 'Success') {
         foreach ($resp->searchResult->item as $item) {
             $item->currencyId = $item->sellingStatus->convertedCurrentPrice['currencyId'];
             $instance = CE_Ebay_API::get_instance();
             $instance->_import($item);
         }
     }
 }
<div id="ebay-settings" class="ebay-settings ebay-box">
	<?php 
$ap_id = get_option('ebay_app_id');
$option = CE_Ebay::get_option();
?>
	<div class="row">
		<div class="title font-quicksand"><?php 
_e("eBay API", ET_DOMAIN);
?>
</div>
		<div class="desc no-left">
			<?php 
_e("Configure your eBay API", ET_DOMAIN);
?>
		</div>
	</div>
	<form action="#" method="post" class="save-setting">
		<div class="row simply-ebay-form">

			<div class="form-item">
				<label><?php 
_e('Your APP ID on eBay.com', ET_DOMAIN);
?>
: </label>
				<input type="text" class="option-item bg-grey-input " placeholder="<?php 
_e('APP ID', ET_DOMAIN);
?>
" value="<?php 
echo $option['app_id'];
?>
" id="app_id" name="app_id" title="App ID">