Exemple #1
0
 function revise()
 {
     require_once 'eBayApi/ReviseFixedPriceItem.php';
     require_once 'eBayApi/ReviseItem.php';
     $ebayAccount = BeanFactory::getBean('xeBayAccounts');
     $accounts = $ebayAccount->get_accounts('All');
     $scope = array('description', 'sku');
     $authToken = $accounts[$this->xebayaccount_id];
     if ($this->listing_type != 'Chinese') {
         if ($this->bid_count > 0) {
             return;
         }
         $ri = new ReviseItem();
         $ri->ryi(array('ItemID' => $this->item_id, 'Description' => $this->description_html(), 'ApplicationData' => xeBayListing::guid_to_uuid($this->id), 'SKU' => $this->id, 'scope' => $scope, 'AuthToken' => $authToken));
     } else {
         $rfpi = new ReviseFixedPriceItem();
         $rfpi->ryi(array('ItemID' => $this->item_id, 'Description' => $this->description_html(), 'ApplicationData' => xeBayListing::guid_to_uuid($this->id), 'SKU' => $this->id, 'scope' => $scope, 'AuthToken' => $authToken));
     }
     $this->association_update(true);
     return true;
 }
Exemple #2
0
 function revise()
 {
     $ebayAccount = BeanFactory::getBean('xeBayAccounts');
     $accounts = $ebayAccount->get_accounts('All');
     $ri = new ReviseItem();
     $rfpi = new ReviseFixedPriceItem();
     $scope = array('description', 'sku');
     $authToken = $accounts[$this->xebayaccount_id];
     if (empty($this->variation)) {
         if ($this->bid_count > 0) {
             return;
         }
         $ri->ryi(array('ItemID' => $this->item_id, 'Description' => $this->get_description(), 'ApplicationData' => xeBayListing::guid_to_uuid($this->xebaylisting_id), 'SKU' => $this->xinventory_id, 'scope' => $scope, 'AuthToken' => $authToken));
         $count++;
     } else {
         $rfpi->ryi(array('ItemID' => $this->item_id, 'Description' => $this->get_description(), 'ApplicationData' => xeBayListing::guid_to_uuid($this->xebaylisting_id), 'SKU' => $this->xinventory_id, 'scope' => $scope, 'AuthToken' => $authToken));
         $count++;
     }
 }
Exemple #3
0
 function action_updatefinal()
 {
     $format = isset($_REQUEST['format']) ? $_REQUEST['format'] : array();
     $scope = isset($_REQUEST['scope']) ? $_REQUEST['scope'] : array();
     if (!empty($format) && !empty($scope)) {
         if (0) {
             echo "<pre>";
             print_r($format);
             print_r($scope);
             echo "</pre>";
         }
         $bean = BeanFactory::getBean('xeBaySellerLists');
         $auction_list = array();
         $fixedpirce_list = array();
         if (in_array('auction', $format)) {
             $auction_list = $bean->get_full_list("", "listing_type='Chinese'");
         }
         if (in_array('fixedprice', $format)) {
             $fixedprice_list = $bean->get_full_list("", "listing_type='FixedPriceItem'");
         }
         if (empty($auction_list)) {
             $auction_list = array();
         }
         if (empty($fixedprice_list)) {
             $fixedprice_list = array();
         }
         $item_list = array_merge($auction_list, $fixedprice_list);
         $ri = new ReviseItem();
         $rfpi = new ReviseFixedPriceItem();
         set_time_limit(60 * 10);
         $ebayAccount = BeanFactory::getBean('xeBayAccounts');
         $accounts = $ebayAccount->get_accounts('All');
         $count = 0;
         foreach ($item_list as &$item) {
             $authToken = $accounts[$item->xebayaccount_id];
             if (empty($item->variation)) {
                 if ($item->bid_count > 0) {
                     continue;
                 }
                 $ri->ryi(array('ItemID' => $item->item_id, 'Description' => $item->get_description(), 'ApplicationData' => xeBayListing::guid_to_uuid($item->xebaylisting_id), 'SKU' => $item->xinventory_id, 'scope' => $scope, 'AuthToken' => $authToken));
                 $count++;
             } else {
                 $rfpi->ryi(array('ItemID' => $item->item_id, 'Description' => $item->get_description(), 'ApplicationData' => xeBayListing::guid_to_uuid($item->xebaylisting_id), 'SKU' => $item->xinventory_id, 'scope' => $scope, 'AuthToken' => $authToken));
                 $count++;
             }
         }
         $GLOBALS['message'] = "Revised {$count} listings succeed!";
     } else {
         $GLOBALS['message'] = "Did not make any change!";
     }
     $this->view = 'updatefinal';
 }