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++; } }
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; }
public function retrieveSellerList($params) { $account_id = $params['AccountID']; $this->session->setRequestToken($params['AuthToken']); $result = true; $bean = BeanFactory::getBean('xeBaySellerLists'); $outputSelector = array('HasMoreItems', 'ItemArray.Item.ApplicationData', 'ItemArray.Item.HitCount', 'ItemArray.Item.ItemID', 'ItemArray.Item.ListingDetails.ConvertedStartPrice', 'ItemArray.Item.ListingDetails.EndTime', 'ItemArray.Item.ListingDetails.ViewItemURL', 'ItemArray.Item.ListingType', 'ItemArray.Item.PictureDetails.PictureURL', 'ItemArray.Item.Quantity', 'ItemArray.Item.SellingStatus.BidCount', 'ItemArray.Item.SKU', 'ItemArray.Item.Title', 'ItemArray.Item.Variations', 'ItemsPerPage', 'PageNumber', 'ReturnedItemCountActual'); $req = new GetSellerListRequestType(); // $req->setErrorLanguage('zh_HK'); $req->setDetailLevel('ReturnAll'); $req->setIncludeVariations(true); $req->setEndTimeFrom($params['EndTimeFrom']); $req->setEndTimeTo($params['EndTimeTo']); $req->setOutputSelector($outputSelector); $pagination = new PaginationType(); $pagination->setEntriesPerPage(100); $pageNumber = 1; $hasMoreItems = false; do { $pagination->setPageNumber($pageNumber++); $req->setPagination($pagination); $res = $this->proxy->GetSellerList($req); if ($this->testValid($res)) { $hasMoreItems = $res->getHasMoreItems(); $returnedItemCountActual = $res->getReturnedItemCountActual(); $itemArray = $res->getItemArray(); if (empty($itemArray)) { break; } foreach ($itemArray as &$item) { $bean->xebayaccount_id = $account_id; $bean->xebaylisting_id = xeBayListing::uuid_to_guid($item->getApplicationData()); $bean->hitcount = $item->getHitCount(); $bean->item_id = $item->getItemID(); $bean->currency_id = $item->getListingDetails()->getConvertedStartPrice()->getTypeAttribute('currencyID'); $bean->price = $item->getListingDetails()->getConvertedStartPrice()->getTypeValue(); $bean->endtime = $item->getListingDetails()->getEndTime(); $bean->view_item_url = $item->getListingDetails()->getViewItemURL(); $bean->listing_type = $item->getListingType(); if ($bean->listing_type == 'PersonalOffer') { continue; } $bean->picture_details = $this->fill_picture_details($item); $bean->bid_count = $item->getSellingStatus()->getBidCount(); $bean->quantity = $item->getQuantity(); $bean->xinventory_id = $item->getSKU(); $bean->name = $item->getTitle(); $variations = $item->getVariations(); $bean->variation = !empty($variations); $bean->id = create_guid(); $bean->new_with_id = true; $bean->save(); } } else { $this->dumpObject($res); $result = false; break; } } while ($hasMoreItems); return $result; }
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'; }